Disable proxy when using apt-get

I love apt-get: most of the world’s open source software at ones fingertips! I use a Linux laptop for all my work, and I use it at work behind a proxy and at home connected directly to the Internet. I setup my apt.conf to look like this so that I can still use apt-get when I am in the office, behind a proxy.

Acquire::http::proxy "http://username:password@proxy.host.name:8080/";
Acquire::https::proxy "https://username:password@proxy.host.name:8080/";
Acquire::ftp::proxy "ftp://username:password@proxy.host.name:8080/";
Acquire::socks::proxy "socks://username:password@proxy.host.name:8080/";

Works perfectly when I’m at the office. Problem was that whenever I was at home I could’t use apt-get any more. It always seemed to want to connect to the proxy, even if I blitzed that config file and removed all the entries. Various searches on the Internet didn’t help, until I finally found this option.


When I’m at home, I run apt-get thusly.

sudo apt-get -o Acquire::http::proxy=false install kgraphviewer


7 thoughts on “Disable proxy when using apt-get

  1. Thank you for freeing me from the hash sum mismatch errors I often get when using a proxy! Once I do an apt-get -o Acquire::http::proxy=false update, I can then run apt-get upgrade without those annoying errors.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s