Ubuntu – Setting proxy for apt from terminal


Possible Duplicate:
apt-get does not work with proxy

I have tried changing my proxy settings in a terminal as:

export HTTP_PROXY=


export http_proxy=

but when I try to install a new package or update apt-get, apt-get starts displaying messages from which it seems it is trying to connect to a previously set proxy:

sudo apt-get update  
0% [Connecting to (] [Connecting to (

I have tried setting the proxy via bashrc file but that din work either. As far as I remember was set using GNOME GUI but I don't have access to the GUI right now so I am trying to set it from terminal.

Best Answer

Okay just solved it. Adding following line to /etc/apt/apt.conf has solved the problem: Acquire::http::proxy "";

If file does not exist, create it. Do not confuse it with apt.conf.d directory.

Related Question