in reply to Re^2: Problem installing CPAN modules
in thread Problem installing CPAN modules

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.

Replies are listed 'Best First'.
Re^4: Problem installing CPAN modules
by daverave (Scribe) on Jun 28, 2010 at 09:20 UTC
    I can't get it to work on sudo for perl.
    vadmin@ubu1004:~$ sudo bash root@ubu1004:~# export HTTP_PROXY=http://myproxy:8080 root@ubu1004:~# echo $HTTP_PROXY http://myproxy:8080 root@ubu1004:~# sudo echo $HTTP_PROXY http://myproxy:8080 root@ubu1004:~# perl -wle 'print $ENV{HTTP_PROXY}' http://myproxy:8080 root@ubu1004:~# sudo perl -wle 'print $ENV{HTTP_PROXY}' Use of uninitialized value in print at -e line 1.

      You're starting another sudo shell within your first sudo shell. Each new shell starts with the fresh values. Within the first sudo shell, all commands (without sudo prepended) should work now.

        First, thanks for your patience!

        Second, it still does not work. The fetching still lingers forever. It is the same for simple wget for some arbitrary site. as said before, surfing with firefox works perfectly. Could it be related to the passive thread I mentioned in the original post?