Using Apt-Get behind a http proxy (Ubuntu 10.10)

• Craig

If you are using Ubuntu server behind a proxy you will need to manually add it. There are a few ways of doing this but this is what worked for me..

Usually when adding a proxy via the CLI in ubuntu you would use the http_proxy variables and add it to the /root/.bashrc file..

http_proxy http://user:password@proxy:port/
export http_proxy

For some reason I have had a few issues with this but have found that editing /etc/apt/apt.conf with the following line works a treat.. I’m not to sure why but if it works it works.

Acquire::http::Proxy http://proxy:port

Now run sudo apt-get update and you should see that apt is able to contact the necessary servers.