Immer wieder stehe ich vor dem gleichen Problem, wenn ich auf einem neuen Server Perl Module mit cpan installieren will.

Ich bekomme keine Verbindung zu den Installationsservern, da cpan nichts von unserem Proxy weiß. Meine bash Umgebung ist gut konfiguriert, deshalb kann ich mir mit

env | grep -i proxy

den Proxy anzeigen lassen. Und damit kann ich dann wieder cpan meine Proxy Einstellungen beibringen:

# cpan
cpan[1]> o conf init /proxy/

If you are accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.

Your ftp_proxy? [] ftp://proxy:8080

Your http_proxy? [] http://proxy:8080   

Your no_proxy? []

If your proxy is an authenticating proxy, you can store your username
permanently. If you do not want that, just press RETURN. You will then
be asked for your username in every future session.

Your proxy user id? [] 

Please remember to call 'o conf commit' to make the config permanent!

cpan[2]> o conf commit
commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

Das war’s. Natürlich muss der Proxy entsprechend angepasst werden, er wird sicherlich nicht immer proxy:8080 heißen.