How to install CPAN module on the whole site while local :: lib is present?

I recently created a new system and wanted to install Padre to test this. Padre installation instructions specifically designed to install local :: lib, so I did it (although I never needed this before). Then I went along the path of installing several other modules, starting CPAN from my regular user account using sudoto process the root parts of the installation.

Then it was time to check out one of the web applications that these modules were necessary for support, and now, apache could not find them. They booted fine from the command line, and a quick look in ~/perl5confirmed my suspicion that local :: lib had captured my CPAN sessions and installed these modules there, and not on the site, despite my CPAN configuration, which included

makepl_arg         [INSTALLDIRS=site]
mbuildpl_arg       [--installdirs site]

What do I need to do for my CPAN configuration so that the modules are installed on the site, even if the local :: lib is installed? Or will Padre work without him, and can I just delete the local :: lib entirely?

(I don’t want any modules to be installed under ~/perl5unless Padre insists on being there. My development code has its own locations for specific projects, and everything else should be at the whole site level. I don’t need closed location for all users.)

+5
source share
3 answers

Got it. Following the instructions on the local :: lib CPAN page, I installed export PERL_MM_OPT='INSTALL_BASE=~me/perl'one that redefined the setting in my CPAN configuration. Quick export PERL_MM_OPT=returned me to the correct installation location.

, , . , , o conf , , , CPAN ( ).

+8

PERL_MM_OPT = .

, Starman . /root/.bashrc, ( ) :

  • export PERL_LOCAL_LIB_ROOT = "$ PERL_LOCAL_LIB_ROOT:/root/perl5";
  • PERL_MB_OPT = "- install_base/root/perl5";
  • export PERL_MM_OPT = "INSTALL_BASE =/root/perl5";
  • export PERL5LIB = "/root/perl5/lib/perl5: $PERL5LIB";
  • export PATH = "/root/perl5/bin: $PATH";
+1

Based on this comment, it seems that it is local::libinstalling its own version of CPAN.pm. If so, you may need to find the original CPAN.pm and make sure it is loaded when you start your CPAN shell. Sort of:

perl -I /usr/lib/perl5 -MCPAN -e shell

can do it. You may also find it perl -Vuseful to see what the path that the Perl compiler uses for its modules includes.

0
source

All Articles