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