I use apt behind a firewall, so I specify a proxy in the
http_proxy environment variable.
What I have done is added the following line to both
.bashrc (for good measure) of the root user:
When I do the following, it prints the value of the proxy correctly:
sudo echo $http_proxy
However, when I call
sudo apt-get update, it does not seem to see the
http_proxy variable as the root user.
Only when I su to root,
apt-get works as expected, through the proxy, so it obviously sees the variable.
So my question is, as above, why does
sudo apt-get not see the variable?
UPDATE I have just learned that when I call
sudo echo, it echoes the value of the variable set in the current user's profile. But even so, why does
sudo apt-get not use that variable value?