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

前端 未结 3 2018
既然无缘
既然无缘 2021-02-08 18:06

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 sta

相关标签:
3条回答
  • 2021-02-08 18:29

    Several New OS's force (like Redhat 7) force to check presence of local::lib in the perl version, actually its a good thing this enables to users to use CPAN and add,experiment and enjoy new modules to be used with the perl without waiting for sitewide installation (like a root user). By default local::lib looks for $HOME/perl5 dir where the user's local or downloaded modules are located. If you see this problem then you have to do following

    1. sudo su - whatever_user_owns_perl
    2. whatever_perl_install_path/cpan install local::lib
    0 讨论(0)
  • 2021-02-08 18:47

    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
    
    0 讨论(0)
  • 2021-02-08 18:48

    The local namespace was for your own personal modules and wouldn't be found in CPAN. This is something relatively new. At many sites, you might need CPAN modules not in the current version of Perl, or you need a newer version of a particular module. However, you don't have write access to the standard location where CPAN modules are installed.

    What this is doing is installing these modules under the $HOME/perl5/lib/local directory where you'll be able to access them. You would also need to setup a PERL5LIB environment variable (usually in your startup scripts), so Perl will check this directory when locating these modules.

    If you have sudo privileges, use that to install CPAN modules rather than trying this. The following will install the Foo::Bar module into the standard module directory for you (and do any configuration as necessary):

    $ sudo cpan install Foo::Bar
    

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

    There are complete directions on doing the local::lib install for modules on MetaCPAN. They're pretty clear.

    0 讨论(0)
提交回复
热议问题