Cannot find local /lib.pm in @INC at / usr / share / perl / 5.14 / CPAN / FirstTime.pm

I am trying to use Perl for the first time on my system, which is Ubuntu 12.04. I have Perl v.5.14.2 installed.
I looked at how to install Perl modules , so I started as follows:

$ perl -MCPAN -e shell 

The wizard started setting up the environment, as can be seen here: http://pastebin.com/5hn8vkb5
Although, he stopped in the middle with the following error message:

 ... Checksum for /home/john/.cpan/sources/authors/id/A/AP/APEIRON/local-lib-1.008009.tar.gz ok ---- Unsatisfied dependencies detected during ---- ---- APEIRON/local-lib-1.008009.tar.gz ---- ExtUtils::MakeMaker [build_requires] Running make test Make had some problems, won't test Delayed until after prerequisites Running make install Make had some problems, won't install Delayed until after prerequisites Can't locate local/lib.pm in @INC (@INC contains: /home/john/perl5/lib/perl5 /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl /home/john/Desktop) at /usr/share/perl/5.14/CPAN/FirstTime.pm line 1300. 

What can I do to properly configure the Perl environment on my Ubuntu installation?


After interrupting the wizard and restarting it, there is again no error message. How can I run the wizard again to select here:

Which approach do you need? (Select 'local :: lib', 'sudo' or 'manual') [Local :: Lib]

+7
source share
3 answers

You are missing local::lib what you said in the CPAN shell.

You can install it like this:

 sudo apt-get install liblocal-lib-perl 

You might be able to start with rm -rf in your ~/.cpan . AT YOUR OWN RISK

However, I would recommend trying cpanminus instead of the old CPAN shell .

 sudo apt-get install cpanminus 
+14
source

The local namespace is for your personal modules and will not be found in CPAN. This is something relatively new. On many sites, you may need CPAN modules not in the current version of Perl, or you need a newer version of a specific module. However, you do not have write access to the standard location where the CPAN modules are installed.

What it is - installing these modules in the $HOME/perl5/lib/local directory where you can access them. You will also need to set the PERL5LIB environment PERL5LIB (usually in startup scripts), so Perl will check this directory when looking for these modules.

If you have sudo privileges, use this to install CPAN modules, rather than trying to do so. Below, the Foo::Bar module will be installed in the standard module directory for you (and, if necessary, make any configuration):

 $ sudo cpan install Foo::Bar 

If CPAN needs to be configured, it will do it first.

There are complete instructions for performing a local installation :: lib for modules on MetaCPAN . They are pretty clear.

+2
source

Several new OS forces (for example, Redhat 7) force us to check for local :: lib in the perl version, which is actually good, which allows users to use CPAN, add, experiment and use new modules that will be used with perl without waiting for installation on sites (e.g. root user). By default, local :: lib searches for the $ HOME / perl5 file where local or loaded user modules are located. If you see this problem, you need to do the following

  • sudo su - whatever_user_owns_perl
  • whatever_perl_install_path / cpan install local :: lib
0
source

All Articles