I use ubuntu 9.04. When in college, due to the proxy server there, I had added the proxy to most of the applications that I needed to use behind proxy. I had also set the proxy settings for apt-get and synaptic package manager and they used to work when in the college network.
When I came home, as there is no proxy server here, I removed the proxy settings at all the places I could remember of: (1) In system->preferences->network proxy, (2) system->administration->synaptic package manager, (3) /etc/apt/apt.conf, (4) .bashrc, etc.
But apt-get and synaptic were not working. I searched a lot for the solution and all the results mentioned the above things only. Then I came across this wonderful blog: http://burakdd.wordpress.com/2009/08/24/removing-proxy-server-from-ubuntu-9-04/ and I learnt about this command:
which did the trick for me! Now, as I blog, the apt-get update is under progress 🙂
I thought that this has to be documented, so here I am!