How to install packages with apt-get on a system connected via proxy?
Abstract :
The apt-get work via proxy.
Introduce :
Proxy is widespread using in network. Ubuntu is base on Linux
and it can use proxy too. However the apt-get is not working if u
only set proxy on OS.
Recently, I got Ubuntu 10.04 system connected via a proxy to
the internet and I found apt-get can't work. So next is the
solution.
1. Check the file /etc/apt/apt.conf.
2. if it is not here, create it.
3. Add these contents :
Acquire::http::proxy "http://<proxy>:<port>/";
Acquire::ftp::proxy "ftp://<proxy>:<port>/";
Acquire::https::proxy "https://<proxy>:<port>/";
4. If ur proxy has password, u should add these :
Acquire::http::proxy
"http://<username>:<password>@<proxy>:<port>/";
Acquire::ftp::proxy
"ftp://<username>:<password>@<proxy>:<port>/";
Acquire::https::proxy
"https://<username>:<password>@<proxy>:<port>/";
5. Save the file and it will work.
Reporter : Nick Chan