Ubuntu Server: Configuring proxies

sudo nano /etc/environment # # (Append these lines at the end of file:) 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" # # (save and... ) source /etc/environment # To unset proxies: # sudo nano /etc/environment # # (Remove proxies lines (see above)) # # (save and them...) unset http_proxy unset https_proxy unset ftp_proxy unset no_proxy unset HTTP_PROXY unset HTTPS_PROXY unset FTP_PROXY unset NO_PROXY # (that's all) # ========== using proxies for apt (it does not obey proxy configuration): # (we create a new file at /etc/apt/apt.conf.d/) # sudo nano /etc/apt/apt.conf.d/95proxies # (now append this lines...) Acquire::http::proxy "http://myproxy.server.com:8080/"; Acquire::ftp::proxy "ftp://myproxy.server.com:8080/"; Acquire::https::proxy "https://myproxy.server.com:8080/"; # (save and run "sudo apt update" for trying...) #
This is the way to configure proxies to Ubuntu Server (perhaps other distros). Easy and fast.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.