gpt4 book ai didi

perl - cpanm 不安装模块

转载 作者:太空宇宙 更新时间:2023-11-03 17:09:36 24 4
gpt4 key购买 nike

我是一个全新的 perl 用户,正在尝试安装 perl 模块及其依赖项。

我正在尝试在新的 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

最佳答案

在新的服务器上这个过程有效

sudo apt-get update
sudo apt-get install unzip make cmake perl build-essential curl cpanminus
echo $?
sudo ln -s /usr/bin/unzip /bin/unzip
mkdir -p /home/ubuntu/perl5
chown -R ubuntu:ubuntu /home/ubuntu/perl5
cpanm --local-lib=/home/ubuntu/perl5 local::lib && eval $(perl -I /home/ubuntu/perl5/lib/perl5/ -Mlocal::lib)
echo "cpanm --local-lib=/home/ubuntu/perl5 local::lib && eval $(perl -I /home/ubuntu/perl5/lib/perl5/ -Mlocal::lib)" >> /home/ubuntu/.bashrc
cpanm File::Copy::Recursive
cpanm --skip-installed LWP::Simple
echo $?

关于perl - cpanm 不安装模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42426564/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com