Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running Ubuntu 12.04 server inside my company network. It requires a proxy in order to access network outside. I configured the proxy during installation. After that, I found my proxy setting was saved in /etc/apt/apt.conf. But it's not in environment variables. However, wget is also able to download a web page through proxy. Where does wget (and other programs) read my proxy setting?

share|improve this question
add comment

4 Answers

up vote 5 down vote accepted

As usual I suppose nobody cared to integrate all the communications settings for the programs used in Linux/Ubuntu, which is a pity.

In 11.10 you have system wide settings in several locations:

/etc/environment

...
http_proxy="user:pass@my.proxy:port
...

/etc/apt/apt.conf.d/02/proxy

The command apt has its settings in this file:

Acquire::http::proxy "http:/user:pass@my.proxy:port"

/etc/wgetrc

The command wget has its settings in this file following the same format as the /etc/environment file mentioned above.

http_proxy="user:pass@my.proxy:port

Provided 12.04 has the same file configuration as 11.10 regarding these three programs you can edit these files for the server.

I had a script file to change all these things in 11.10 back and forth between my work and home, but now I am not using that script until I know more details about how 12.04 works with these issues.

share|improve this answer
add comment

Many of the linux command lines can make use of the environment variables http_proxy and ftp_proxy. Just set these in your .bashrc file or setup a shell script to set these environment variables prior to running commands such as apt or wget etc.

export http_proxy=http://proxyserver:port/
export ftp_proxy=http://proxyserver:port/
share|improve this answer
add comment

wget uses /etc/wgetrc in which you'll find HTTP and HTTPS proxy lines to uncomment and edit with your proxy settings.

share|improve this answer
add comment

wget, and many other programs, get proxy information from the http_proxy environment variable. Try the command echo $http_proxy in a shell to make it is set.

share|improve this answer
1  
wget maybe but not apt-get (on 12.04.1) –  majkinetor Dec 5 '12 at 15:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.