1
我是一个全新的perl用户,试图安装perl模块及其依赖项。cpanm不会安装模块
我想在新鲜的Ubuntu 16.10云服务器实例上安装我需要的perl依赖项,但它们不会注册为已安装。
例如
cpanm --skip-installed LWP::Simple
显示
--> Working on LWP::Simple
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/libwww-perl-6.21.tar.gz ... OK
Configuring libwww-perl-6.21 ... OK
==> Found dependencies: WWW::RobotRules, Net::HTTP, File::Listing, HTTP::Daemon, Test::RequiresInternet, Test::Fatal, HTTP::Negotiate, HTTP::Cookies
--> Working on WWW::RobotRules
Fetching http://www.cpan.org/authors/id/G/GA/GAAS/WWW-RobotRules-6.02.tar.gz ... OK
Configuring WWW-RobotRules-6.02 ... OK
Building and testing WWW-RobotRules-6.02 ... OK
Successfully installed WWW-RobotRules-6.02
--> Working on Net::HTTP
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/Net-HTTP-6.13.tar.gz ... OK
Configuring Net-HTTP-6.13 ... OK
Building and testing Net-HTTP-6.13 ... OK
Successfully installed Net-HTTP-6.13
...
! Installing the dependencies failed: Module 'File::Listing' is not installed, Module 'HTTP::Daemon' is not installed, Module 'Test::RequiresInternet' is not installed, Module 'HTTP::Cookies' is not installed, Module 'Test::Fatal' is not installed, Module 'HTTP::Negotiate' is not installed, Module 'WWW::RobotRules' is not installed, Module 'Net::HTTP' is not installed
! Bailing out the installation for libwww-perl-6.21.
8 distributions installed
我使用正确的工具? 我在哪里可以找到或生成更详细的错误日志?
下面是我的安装过程中的选择,但实验可能意味着它不具有明确的代表性。
sudo apt-get install unzip make cmake perl build-essential curl cpanminus
cpanm --self-upgrade --sudo
sudo ln -s /usr/bin/unzip /bin/unzip
export PERL_INSTALL_ROOT=/home/ubuntu/perl5
export PERL5LIB=/home/ubuntu/perl5
export PERL_CPANM_OPT="--local-lib=/home/ubuntu/perl5"
mkdir -p /home/ubuntu/perl5
chown -R ubuntu:ubuntu /home/ubuntu/perl5
chown -R ubuntu:ubuntu /home/ubuntu/.cpanm
cpanm --local-lib=/home/ubuntu/perl5 local::lib && eval $(perl -I /home/ubuntu/perl5/lib/perl5/ -Mlocal::lib)
cpanm File::Copy::Recursive
cpanm Archive::Zip
cpanm --skip-installed LWP::Simple
当这发生在我身上,我只是告诉cpanm安装缺少的依赖,直接一个接一个,然后事后再做主要原因之一。我不知道为什么会发生。 – simbabque
当我尝试自己时,我遇到了那些依赖项的依赖关系,无法安装。我设法在第一台服务器上打破了cpanm,所以我不能再生产,但是新的服务器实际上工作,所以我正在继续。 –
就我个人而言,我发现[perlbrew](https://perlbrew.pl/)/ [plenv](https://github.com/tokuhirom/plenv)比使用local :: lib更容易。 – ThisSuitIsBlackNot