所有 CPAN 镜像都不能在 CPAN 配置中工作?

All CPAN mirrors are not working in CPAN configuration?

我正在尝试在 Centos 6 上安装和配置 CPAN。

我在配置中收到此消息:

CPAN.pm requires configuration, but most of it can be done automatically. If you answer 'no' below, you will enter an interactive dialog for each configuration option instead. Would you like to configure as much as possible automatically? [yes]

我选择了是,然后系统提示我这条信息:

Autoconfigured everything but 'urllist'. Now you need to choose your CPAN mirror sites. You can let me pick mirrors for you, you can select them from a list or you can enter them by hand. Would you like me to automatically choose some CPAN mirror sites for you? (This means connecting to the Internet) [yes]

我也选择了是来接收该消息:

Trying to fetch a mirror list from the Internet Fetching with LWP: http://www.perl.org/CPAN/MIRRORED.BY Fetching with LWP: http://www.perl.org/CPAN/MIRRORED.BY.gz Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY Could not connect to host 'ftp.perl.org' with Net::FTP Fetching with Net::FTP ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz Could not connect to host 'ftp.perl.org' with Net::FTP

Trying with /usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459" to get http://www.perl.org/CPAN/MIRRORED.BY --2015-05-25 16:39:15-- http://www.perl.org/CPAN/MIRRORED.BY Resolving www.perl.org... 108.161.188.196 Connecting to www.perl.org|108.161.188.196|:80... failed: No route to host.

Function system("/usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459"

"http://www.perl.org/CPAN/MIRRORED.BY" ") returned status 4 (wstat 1024), left /home/abashir/.cpan/sources/MIRRORED.BY.tmp33459 with size 0

Trying with /usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY --2015-05-25 16:39:15-- ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY => “/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459” Resolving ftp.perl.org... 130.161.131.20, 131.211.32.146 Connecting to ftp.perl.org|130.161.131.20|:21... failed: No route to host. Connecting to ftp.perl.org|131.211.32.146|:21... failed: No route to host.

Function system("/usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459"

"ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY" ") returned status 4 (wstat 1024), left /home/abashir/.cpan/sources/MIRRORED.BY.tmp33459 with size 0 Warning: no success downloading '/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459'. Giving up on it. No external ftp command available

Fetching with LWP: http://www.perl.org/CPAN/MIRRORED.BY Fetching with LWP: http://www.perl.org/CPAN/MIRRORED.BY.gz

Trying with /usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459" to get http://www.perl.org/CPAN/MIRRORED.BY --2015-05-25 16:39:15-- http://www.perl.org/CPAN/MIRRORED.BY Resolving www.perl.org... 108.161.188.196 Connecting to www.perl.org|108.161.188.196|:80... failed: No route to host.

Function system("/usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459"

"http://www.perl.org/CPAN/MIRRORED.BY" ") returned status 4 (wstat 1024), left /home/abashir/.cpan/sources/MIRRORED.BY.tmp33459 with size 0 Warning: no success downloading '/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459'. Giving up on it. Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY Could not connect to host 'ftp.perl.org' with Net::FTP Fetching with Net::FTP ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz Could not connect to host 'ftp.perl.org' with Net::FTP

Trying with /usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY --2015-05-25 16:39:17-- ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY => “/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459” Resolving ftp.perl.org... 131.211.32.146, 130.161.131.20 Connecting to ftp.perl.org|131.211.32.146|:21... failed: No route to host. Connecting to ftp.perl.org|130.161.131.20|:21... failed: No route to host.

Function system("/usr/bin/wget -O "/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459"

"ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY" ") returned status 4 (wstat 1024), left /home/abashir/.cpan/sources/MIRRORED.BY.tmp33459 with size 0 Warning: no success downloading '/home/abashir/.cpan/sources/MIRRORED.BY.tmp33459'. Giving up on it. No external ftp command available

Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'

Could not fetch MIRRORED.BY We failed to get a copy of the mirror list from the Internet. You will need to provide CPAN mirror URLs yourself.

Now you can enter your own CPAN URLs by hand. A local CPAN mirror can be listed using a 'file:' URL like 'file:///path/to/cpan/'

CPAN.pm needs at least one URL where it can fetch CPAN files from.

Please enter your CPAN site: []

然后我查看了荷兰(我住的地方)在perlmodlib的镜像列表,我一个一个输入,配置结束如下。

Please enter your CPAN site: [] ftp://ftp.quicknet.nl/pub/CPAN/ Enter another URL or ENTER to quit: [] http://mirror.hostfuss.com/CPAN/ Enter another URL or ENTER to quit: [] ftp://mirror.hostfuss.com/CPAN/ Enter another URL or ENTER to quit: [] http://mirrors3.kernel.org/cpan/ Enter another URL or ENTER to quit: [] ftp://mirrors3.kernel.org/pub/CPAN/ Enter another URL or ENTER to quit: [] http://cpan.mirror.versatel.nl/ Enter another URL or ENTER to quit: [] ftp://ftp.mirror.versatel.nl/cpan/ Enter another URL or ENTER to quit: [] ftp://download.xs4all.nl/pub/mirror/CPAN/ Enter another URL or ENTER to quit: [] http://mirror.leaseweb.com/CPAN/ Enter another URL or ENTER to quit: [] ftp://mirror.leaseweb.com/CPAN/ Enter another URL or ENTER to quit: [] ftp://ftp.cpan.nl/pub/CPAN/ Enter another URL or ENTER to quit: [] http://archive.cs.uu.nl/mirror/CPAN/ Enter another URL or ENTER to quit: [] ftp://ftp.cs.uu.nl/mirror/CPAN/ Enter another URL or ENTER to quit: [] http://luxitude.net/cpan/ Enter another URL or ENTER to quit: []

New urllist
ftp://ftp.quicknet.nl/pub/CPAN/ http://mirror.hostfuss.com/CPAN/
ftp://mirror.hostfuss.com/CPAN/ http://mirrors3.kernel.org/cpan/
ftp://mirrors3.kernel.org/pub/CPAN/ http://cpan.mirror.versatel.nl/ ftp://ftp.mirror.versatel.nl/cpan/
ftp://download.xs4all.nl/pub/mirror/CPAN/
http://mirror.leaseweb.com/CPAN/ ftp://mirror.leaseweb.com/CPAN/
ftp://ftp.cpan.nl/pub/CPAN/ http://archive.cs.uu.nl/mirror/CPAN/
ftp://ftp.cs.uu.nl/mirror/CPAN/ http://luxitude.net/cpan/

Autoconfiguration complete.

commit: wrote '/home/abashir/.cpan/CPAN/MyConfig.pm'

You can re-run configuration any time with 'o conf init' in the CPAN shell

现在,每当我尝试安装任何模块时,我都会遇到错误,例如尝试安装 XML::Simple,我在试验结束时得到以下信息:

Please check, if the URLs I found in your configuration file (ftp://ftp.quicknet.nl/pub/CPAN/, http://mirror.hostfuss.com/CPAN/, ftp://mirror.hostfuss.com/CPAN/, http://mirrors3.kernel.org/cpan/, ftp://mirrors3.kernel.org/pub/CPAN/, http://cpan.mirror.versatel.nl/, ftp://ftp.mirror.versatel.nl/cpan/, ftp://download.xs4all.nl/pub/mirror/CPAN/, http://mirror.leaseweb.com/CPAN/, ftp://mirror.leaseweb.com/CPAN/, ftp://ftp.cpan.nl/pub/CPAN/, http://archive.cs.uu.nl/mirror/CPAN/, ftp://ftp.cs.uu.nl/mirror/CPAN/, http://luxitude.net/cpan/) are valid. The urllist can be edited. E.g. with 'o conf urllist push ftp://myurl/'

Could not fetch authors/01mailrc.txt.gz Lockfile removed.

您可以查看 Full log of the final step here

我该如何解决这个问题?

运行 cpan shell 第一:

$ sudo perl -MCPAN -eshell

或从根:

# perl -MCPAN -eshell

然后从 cpan shell:

cpan> install Bundle::CPAN

退出 cpan shell 并构建模块列表(可能需要 root):

$ perl -MCPAN -eautobundle

然后安装需要的模块,例如:

# perl -MCPAN -eshell
cpan> notest install Text::Iconv DateTime

模块将安装到 /usr/lib64/perl*/ 用于 x86_64 系统。

您似乎使用了代理。您必须在 CPAN shell:

中配置代理
o conf http_proxy 'http://user:password@proxy.com'