Using apt-get behind a proxy (Ubuntu)

It is quite difficult to use apt-get in ubuntu when you are behind a proxy. To be able to install packages behind a proxy, you need to have a few details:


username: The user name with with you get through the proxy
password: The password with with you get through the proxy
proxyserver: The proxy server
port: The port with with you connect to the proxy server (default is 80)

The proxy can be set in two ways:

Edit your /etc/apt/apt.conf file as root.
Put these line at the end of your /etc/apt/apt.conf file :

Acquire::http::Proxy "http://username:password-AT-proxyserver:port/"

OR

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-AT-proxyserver-DOT-net:port/
export ftp_proxy=http://username:password@proxyserver-DOT-netport/

You can omit the username:password, if your proxy server has no password. That’s all for today! Happy apt-get-ing!
Comments:

You may do it the GUI way too:

Goto System -> Preferences -> Network Proxy & fill in the required details. :)

Posted by Saurabh Aggarwal on September 20, 2008 at 05:44 AM IST #

Nice bit of useful information Avinash. Thanks. :)

Posted by Guruprasad on September 21, 2008 at 07:37 AM IST #

Any similar things for OpenSolaris?

Posted by Guruprasad on September 21, 2008 at 02:20 PM IST #

No Guru Bhai.. Proxy is not yet supported on OpenSolaris..

Posted by Avinash Joshi on September 22, 2008 at 06:27 PM IST #

I just exported a http_proxy variable and it worked in OpenSolaris! :)

Posted by Guruprasad on September 24, 2008 at 10:22 AM IST #

I didn't work for me: URLError, reason: (8, 'node name or service name not known')

Posted by Gomer Gonzalez on February 23, 2009 at 02:08 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

I am a Campus Ambassador, Amrita Vishwa Vidyapeetham. This is my technical-cum-non technical blog. You can also view my personal site: http://avinashjoshi.co.in

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today