Perl – All CPAN mirrors are not working in CPAN configuration

centos6configurationcpanperl

I am trying to install CPAN and configure it on Centos 6.

I am getting this message in configuration:

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]

I chose yes, then I am prompted with this message:

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]

I also chose yes to get that message:

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: []

Then I checked the list of mirrors to in perlmodlib for netherlands(where I live), and I entered them one by one, and configuration was terminated as follows.

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

Now, whenever I try to install any module, i get errors, for example trying to install XML::Simple, I get the following at the end of trials:

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.

You can check the Full log of the final step here

How may I solve this ?

Best Solution

You seem to be behind a proxy. You have to configure the proxy in CPAN shell:

o conf http_proxy 'http://user:password@proxy.com'