How to set proxy in terminal

Setting proxy in terminal is very straight forward. Use export command to set it.

export http_proxy=http://proxyip:proxyport

Replace proxyip with the ip of the proxy and proxyport with the port of proxy.
In case your proxy requires authentication, use

export http_proxy=http://username:password@proxyip:proxyport

For example, the command becomes (in my university)

export http_proxy=http://282421:pass@

You need to enter this command in each terminal you open or you can enter this in ~/.bashrc.
After setting proxy in the terminal, you may now use wget or apt-get/yum without getting error Connection refused.

You may be wondering, why I am posting only on proxy. The only reason is i got struck on proxy settings on my first installation of linux and removed it. It took a long time when i started using linux again. Also, i am behind a proxy server in my college and aim to provide simple articles for beginners.


~ by atulaggarwal on April 28, 2009.

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: