Skip to content

Instantly share code, notes, and snippets.

@adeolaawoyemi
Created November 23, 2010 14:30
Show Gist options
  • Save adeolaawoyemi/711839 to your computer and use it in GitHub Desktop.
Save adeolaawoyemi/711839 to your computer and use it in GitHub Desktop.
perl CPAN Timeouts
I started seeing this error when I used CPAN to fetch stuff:
Fetching with LWP:
ftp://ftp.planetmirror.com/pub/perl/CPAN/modules/02packages.details.txt.gz
LWP failed with code[400] message[FTP return code 000]
Fetching with Net::FTP:
ftp://ftp.planetmirror.com/pub/perl/CPAN/modules/02packages.details.txt.gz
Couldn't fetch 02packages.details.txt.gz from ftp.planetmirror.com
Fetching with LWP:
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/02packages.details.txt.gz
LWP failed with code[400] message[FTP return code 000]
Fetching with Net::FTP:
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/02packages.details.txt.gz
Couldn't fetch 02packages.details.txt.gz from cpan.nas.nasa.gov
Fetching with LWP:
ftp://cpan.llarian.net/pub/CPAN/modules/02packages.details.txt.gz
The fix is simple but not particularly easy to track down.
This is likely happening because you are behind a NAT or firewall, and you need to do ftp in passive mode.
Find your perls libnet.cfg file:
% locate libnet.cfg
/usr/local/share/perl/5.6.1/Net/libnet.cfg
Edit that file and change the ftp_int_passive setting to 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment