Install CPAN modules without root

I used this useful tutorial to install Perl for my user only. I am sorry that the link to an external site, but I think that reading is the only way to understand how to answer the question.

Anywho, I load the default CPAN configuration - directories .cpanand CPANcreated through the tutorial, but for some reason CPAN still wants to delve into /usr/lib/- which it just can't get - when I try to install the module. It was at installation DBD::CSV.

Here is the error message:

All tests successful (7 subtests UNEXPECTEDLY SUCCEEDED), 3 tests skipped.
Files=23, Tests=706,  3 wallclock secs ( 2.28 cusr +  0.54 csys =  2.82 CPU)
/usr/bin/make test -- OK
Running make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/perl5lib/lib/Bundle/DBD'
mkdir /perl5lib: Permission denied at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 457
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1
make: *** [pure_site_install] Error 13
/usr/bin/make install  -- NOT OK

It seems wrong is happening perl5lib.

+5
source share
4 answers

, :: lib . cpanm cpan. , ~/perl5/lib/perl5. .

+5

local:: lib INSTALL_BASE, . perlbrew Perl.

  • Perl, .
  • Perl - .
  • INSTALL_BASE.
  • .
+5
+2

Did you configure myconfig.pm inside cpan instead of letting it automatically populate all the default values? During the cpan configuration, you had to add PREFIX = "for the Makefile.PL part to install the modules in this new place where you have write access. Since it is already configured automatically for you, go to .cpan / CPAN /, find MyConfig.pm and edit it. Find the line "makepl_arg" and change the value in [] to contain PREFIX = "". Then try the shell perl -MCPAN -e and install the module.

0
source

All Articles