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

gSTM configuration by hand

Gnome has a handy utility for managing your SSH tunnels called gSTM (Gnome SSH Tunnel Manager). But if you have to manage a large number of tunnels, the GUI becomes quite painful. Instead, you can edit the configuration files by hand. The files are stored under $HOME/.gSTM.

$ ls -l ~/.gSTM
total 12
-rw-rw-r– 1 chandru chandru 1354 Sep  3 04:50 jumpbox1.reJBkD.gstm
-rw-rw-r– 1 chandru chandru 2901 Sep  5 09:51 jumpbox2.0VZHUf.gstm
-rw-rw-r– 1 chandru chandru 1212 Aug 31 14:51 jumpbox3.Fg3FFh.gstm

A sample entry in one of the configuration file looks like this.