LWP failed with code[400]

When installing Perl modules with cpan, it is possible to get a error due to the firewall.

Fetching with LWP:
LWP failed with code[400] message[FTP return code 150]
Fetching with Net::FTP:

after doing:

perl -MCPAN -e shell

It typically hangs for a while while trying to fetch for a while over LWP or FTP
The simple fix is: export FTP_PASSIVE=1 before calling sudo perl -MCPAN -e shell or sudo cpan as the case may be.

The same thing ca be done within cpan with o conf ftp_passive

Leave a Reply