Idea: My idea is to be a domestic Ubuntu cloud host can be used in another foreign (Singapore) server, to achieve access to Google, haha, better check information:)
The following procedure to modify the/etc/environment file, and then restart reboot this server, found Apt-get install software will also go this agent to install software,
, haha, this domestic server is inaccessible, some software that cannot be installed can be installed!!! Whoa, whoa. :)
-------------------------------------------------------How do I configure proxies without GUI?
2 Answersactiveoldestvotes
Up vote84down vote |
System-wide proxies in CLI Ubuntu/server must bes set as environment variables.
- Open the
/etc/environment file with vi (or your favorite editor). This file stores the System-wide variables initialized upon boot.
Add the following lines, modifying appropriately. You must duplicate in both Upper-case and lower-case because (unfortunately) some programs only look for one or the other: Http_proxy= "http://myproxy.server.com:8080/" https_proxy= "http://myproxy.server.com:8080/" ftp_proxy= "http// myproxy.server.com:8080/"no_proxy=" localhost,127.0.0.1,localaddress,.localdomain.com "HTTP_PROXY="/HTTP/ myproxy.server.com:8080/"https_proxy=" http://myproxy.server.com:8080/"ftp_proxy=" http://myproxy.server.com : 8080/"no_proxy=" localhost,127.0.0.1,localaddress,.localdomain.com "
apt-get , aptitude , etc. won't obey the environment variables when used normally with sudo . So separately configure them; Create a file called 95proxies /etc/apt/apt.conf.d/ in, and include the following:
Acquire::http::p Roxy "http://myproxy.server.com:8080/"; Acquire::ftp::p Roxy "ftp://myproxy.server.com:8080/"; Acquire::https::p Roxy "https://myproxy.server.com:8080/";
Finally, logout and reboot to make sure the changes take effect. Sources:1, 2. See 1 in particular for additional help, including a script to quickly turn on/off the proxies. |
Ubuntu How do I configure proxies without GUI?