Using Debian apt-get behind a proxy

If you are setting up Debian on a network that is behind a proxy server, you will probably have trouble getting out onto the internet using apt-get. Luckily this isn’t too hard to fix.

To fix it permanently simply edit your /etc/bash.bashrc file and add these lines:

export http_proxy=http://username:password@proxyserver.net:port/
export ftp_proxy=http://username:password@proxyserver.netport/

To fix it on a case by case basis, just run each command, like this:

# export http_proxy=http://username:password@proxyserver.net:port/

NOTE : I have also seen the problem where I have done this on one network, then changed to a network without a proxy and the system continues to look for the proxy even though I have removed these lines from my .bashrc file.
The way around it is to set the http_proxy and ftp_proxy values to null. Like this:

# export http_proxy=
# export ftp_proxy=

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