daverave has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm using Ubuntu 10.04 on VMware player under Windows. I am behind a proxy, and it is well defined in the Ubunto virtual machine under System>Preferences>Network Proxy. I can surf the web with no problems using the browser in the VM.

I am trying to install GBrowse as explained in http://gmod.org/wiki/GBrowse_Ubuntu_HOWTO. Installing Apache, Apache-modperl, MySQL and the rest of the prereqs was a breeze, but when I start sudo perl gbrowse_netinstall.pl I got

*** Installing Perl files needed for a net-based install *** Dispatching deprecated method 'CPAN::Config::load' to CPAN::HandleConf +ig Dispatching deprecated method 'CPAN::Config::commit' to CPAN::HandleCo +nfig commit: wrote '/etc/perl/CPAN/Config.pm' CPAN: Time::HiRes loaded ok (v1.9719) Warning: no success downloading '/home/vadmin/.cpan/sources/authors/01 +mailrc.txt.gz.tmp18577'. Giving up on it. at /usr/share/perl/5.10/CPA +N/Index.pm line 225 Fetching with LWP: http://www.perl.org/CPAN/authors/01mailrc.txt.gz LWP failed with code[500] message[read timeout] Trying with "/usr/bin/wget -O /home/vadmin/.cpan/sources/authors/01mai +lrc.txt.tmp18577" to get "http://www.perl.org/CPAN/authors/01mailrc.txt.gz" --2010-06-28 12:26:11-- http://www.perl.org/CPAN/authors/01mailrc.txt +.gz Resolving www.perl.org... 207.171.7.63 Connecting to www.perl.org|207.171.7.63|:80... connected. HTTP request sent, awaiting response...
and it lingers like that with no change...

I entered http://www.perl.org/CPAN/authors/01mailrc.txt.gz in my browser address basr and I can see the file. I tried wget http://www.perl.org/CPAN/authors/01mailrc.txt.gz from the shall and I get the same

http://www.perl.org/CPAN/authors/01mailrc.txt.gz Resolving www.perl.org... 207.171.7.63 Connecting to www.perl.org|207.171.7.63|:80... connected. HTTP request sent, awaiting response...

I tried wget http://www.perlmonks.org/ and also got

http://www.perl.org/CPAN/authors/01mailrc.txt.gz Resolving www.perl.org... 207.171.7.63 Connecting to www.perl.org|207.171.7.63|:80... connected. HTTP request sent, awaiting response.

What's going on here?

UPDATE

Following http://davesource.com/Solutions/20040620.CPAN-Timeouts.html I set ftp_int_passive => 1in ./etc/perl/Net/libnet.cfg, but this does not seem to make a difference.

Replies are listed 'Best First'.
Re: Problem installing CPAN modules
by Corion (Patriarch) on Jun 28, 2010 at 08:51 UTC

    Most likely (and that's just a raw guess), your user has the HTTP proxy environment variables set up, and these get lost when you issue a command to run as the superuser via sudo. Look at whether there is a difference between:

    echo $HTTP_PROXY perl -wle 'print $ENV{HTTP_PROXY}' sudo perl -wle 'print $ENV{HTTP_PROXY}'
      the first returns an empty null and the second two throw "Use of uninitialized value".

      So I guess my proxy is not set? This is strange, since I can surf and the previous downloads were seem to be fine. How should I set it?

      p.s.
      Please take a look at the update in my original post.

      Thanks!

      UPDATE

      I export HTTP_PROXY=http://myproxy:8080

      Now I get the correct proxy for the first 2 commands, but the one using sudo still returns "Use of uninitialized value"

        So now you need to set that variable for the superuser as well. I usually do that by starting a shell as the superuser:

        sudo bash export HTTP_PROXY=... ... whatever ... # After leaving the shell, all changes are gone again

        You might want to leave it that way for security reasons, so you only consciously pull in a HTTP proxy. If that proxy needs to be used always anyway, you can also modify the .profile of the superuser to set the proxy by editing /root/.profile or /root/.bashrc or even globally for all users by editing /etc/profile or /etc/bashrc or wherever that resides.

Re: Problem installing CPAN modules
by Utilitarian (Vicar) on Jun 28, 2010 at 09:51 UTC
    Hi Dave,

    wget allows you specify a proxy to use on the command line or via a no_proxy env setting, however there is a known issue with the no_proxy setting in ubuntu, to resolve

    ~/$ export no_proxy=$(echo $no_proxy | sed 's/,$//')
    and try again

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
Re: Problem installing CPAN modules
by Anonymous Monk on Jan 06, 2016 at 18:40 UTC
    I guess I have a question to why is a mail ALIAS list required to do a CPAN INSTALL. I asked a CPAN developer and quickly got dismissed with no explanation other than that is that way it goes. I do not see any need for a successful loading of over 12000 mail aliases just to do a Perl Module build. Anyone have an idea on what this accomplishes?