Ubuntu:3 ways to use apt-get behind a proxy server

Posted on December 18, 2008

You know that many companies use a proxy server to control the internet access of staff.So how to use apt-get to update or install softwares in the situation.In fact there are 3 way to do it.

1.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@proxyserver:port/"
 
Acquire::ftp_Proxy "http://username:password@proxyserver:port/"

2.Edit your /etc/bash.bashrc file as root.Also put these same line at the end of your /etc/bash.bashrc file :

export http_Proxy="http://username:password@proxyserver:port/"
 
export ftp_Proxy="http://username:password@proxyserver:port/"

3.Maybe we only need to use apt-get for a short time,then we can just export to enviroments in the command lines.

export http_Proxy="http://username:password@proxyserver:port/"
 
export ftp_Proxy="http://username:password@proxyserver:port/"

Note:You can ignore the “username:passord” if there is no passord of your proxy server

Popularity: 5% [?]

» Filed Under Linux

Comments

Leave a Reply