How to set proxy for Ubuntu Server 11.10

I spent lot of time figuring out how to set proxy on Ubuntu Server from command line. There are multiple ways mentioned on internet. Some works and some dont. Here’s what works and what dont. Hope this is useful.

What works: This worked first time :-) .

Create the file /etc/apt/apt.conf and put this line with your proxy settings : (By default I found that this file does not exist. so you need to create this).

Acquire::http::Proxy “http://login:password@yourproxyaddress:port“;

example:¬† Acquire::http::Proxy “http://bob:123bob@bobproxy:8070“;

What does not work: For me this method even after trying multiple times did not work.

Edit  your /etc/bash.bashrc file as root.

Put these line at the end of your /etc/bash.bashrc file :

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

Be Sociable, Share!
This entry was posted in Open Source. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>