listanand has asked for the wisdom of the Perl Monks concerning the following question:
Dear PerlMonks,
I am new to Perl, and I need to install some modules on a machine in which I have no root (or any elevated) privileges. I looked around the internet and it appears that I will be better off using CPAN prompt since it can also install the dependencies, instead of manually installing the modules, and then go around installing the dependencies (also manually).
So, I tried using CPAN (perl -MCPAN -e shell) then followed configuration instructions, and then selected a local directory as location for doing Perl Makefile.pl (I chose PREFIX = <local directory> while doing the configuration) and also chose a local directory for 'make install' (using INSTALLMAN3DIR=<local dir>).
After this I get to the CPAN prompt. Now when I try to install module (say "install LWP") I get errors towards the very end (something like "make test failed").
What am I missing?
Thanks in advance.
Re: Installing Modules Without Root
by superfrink (Curate) on Aug 04, 2009 at 21:35 UTC
|
| [reply] |
|
Dear Perl Monks,
Thank you very much for your timely reply.
This is turning out to be much harder than I thought! I followed the directions given at:
http://sial.org/howto/perl/life-with-cpan/non-root/
After this I go to the CPAN shell and said "install LWP" and at the very end I get an error (below). What am I missing?
============ERROR============
Failed 27/37 test scripts, 27.03% okay. 205/532 subtests failed, 61.47% okay.
make: *** test Error 2
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
============END OF ERROR============
| [reply] |
|
| [reply] |
|
|
|
| [reply] |
|
| [reply] |
|
Re: Installing Modules Without Root
by FunkyMonk (Chancellor) on Aug 04, 2009 at 23:55 UTC
|
| [reply] |
Re: Installing Modules Without Root
by bichonfrise74 (Vicar) on Aug 04, 2009 at 22:46 UTC
|
| [reply] |
Re: Installing Modules Without Root
by Your Mother (Archbishop) on Aug 04, 2009 at 22:30 UTC
|
One of the links given already by superfrink mentions it but it's buried and it shouldn't be. To me it's easily the best way to handle this need: local::lib.
| [reply] |
|
IIRC you probably have a ~/perl or a CPAN preferences file that is interfering, or both. Google around a little before just deleting those but I recognize the error you're getting and I *think* that's how I solved it before.
(update: I apparently replied to my own node instead of Re^2: Installing Modules Without Root.)
| [reply] [d/l] |
|
By preferences file, do you mean ~/.cpan/CPAN/MyConfig.pm? I am not sure how it can interfere. I am posting the contents of MyConfig.pm below. Everything seems right to me...
$CPAN::Config = {
'build_cache' => q10,
'build_dir' => q/home/andy/perl5/build,
'cache_metadata' => q1,
'cpan_home' => q/home/andy/perl5,
'cpan_version_check' => q1,
'ftp' => q/usr/bin/ftp,
'ftp_proxy' => q[],
'getcwd' => qcwd,
'gpg' => q/usr/bin/gpg,
'gzip' => q/bin/gzip,
'histfile' => q/home/andy/perl5/histfile,
'histsize' => q100,
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q1,
'inhibit_startup_message' => q[0],
'keep_source_where' => q/home/andy/perl5/sources,
'lynx' => q/usr/bin/lynx,
'make' => q/usr/bin/make,
'make_arg' => q[],
'make_install_arg' => q[],
'makepl_arg' => qPREFIX=/home/andy/perl5,
'ncftp' => q[],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q/usr/bin/less,
'prerequisites_policy' => qfollow,
'scan_cache' => qatstart,
'shell' => q/bin/bash,
'tar' => q/bin/tar,
'term_is_latin' => q1,
'unzip' => q/usr/bin/unzip,
'urllist' => [qftp://mirror.its.uidaho.edu/cpan/],
'wget' => q/usr/bin/wget,
};
1;
__END__
| [reply] |
|
|
|
|
|
|
OK, so now I am trying to use local::lib to install the modules. However as soon as I run the command " perl Makefile.PL --bootstrap=/my_directory_of_choice" , I get the following message:
Any suggestions?
== Error Begin ==
*** Checking for Perl dependencies...
Core Features
- ExtUtils::MakeMaker ...too old. (6.30_01 < 6.31)
- ExtUtils::Install ...too old. (1.33 < 1.43)
- ExtUtils::CBuilder ...missing.
- ExtUtils::ParseXS ...missing.
- Module::Build ...missing. (would need 0.28)
- CPAN ...too old. (1.7602 < 1.82)
==> Auto-install the 6 mandatory module(s) from CPAN? y y
*** Dependencies will be installed the next time you type 'make'.
(You may need to do that as the 'root' user.)
*** Module::AutoInstall configuration finished.
*** Installing dependencies...
*** You are not allowed to write to the directory '/usr/local/share/perl/5.8.8';
the installation may fail due to insufficient permissions.
==> Should we try to re-execute the autoinstall process with 'sudo'? y y
*** Trying to re-execute the autoinstall process with 'sudo'...
Password:
=Error End==
| [reply] |
|
|