Can't locate local/lib.pm in @INC at /usr/share/perl/5.14/CPAN/FirstTime.pm

JJD picture JJD · May 23, 2013 · Viewed 40.8k times · Source

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

$ perl -MCPAN -e shell

The wizard started configuring the environment as can be seen here: http://pastebin.com/5hn8vkb5
Though, it 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 setup the Perl environment correctly on my Ubuntu installation?


After interrupting the wizard and restarting it again, there is no error message anymore. How can I start the wizard again so I can choose here:

What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') [local::lib]

Answer

chrsblck picture chrsblck · May 23, 2013

You're missing local::lib, which is what you told CPAN shell to do.

You can install it like so:

sudo apt-get install liblocal-lib-perl

You might be able to start over by rm -rf-ing your ~/.cpan directory. AT YOUR OWN RISK

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

sudo apt-get install cpanminus