Ubuntu – How to set system wide proxy in Ubuntu 18.04

18.04networkingPROXY

There is no 'Apply System Wide' option.I have to manually change /etc/apt/apt.conf file every time I set or unset proxy.

How do I configure it so that it applies system wide proxy settings – with apt.conf updating accordingly in Ubuntu 18.04?

EDIT:

Despite setting apt.conf manually, I'm not able to install anything through Ubuntu Software because an "Unsupported proxy configured: proxy.server.com//8080" error comes up. How do I fix this?

Best Answer

Set proxy details in Environment variables;
Edit /etc/environment and add following lines (replace username, password, host and port with your proxy details).

http_proxy=http://username:password@host:port/
ftp_proxy=ftp://username:password@host:port/
https_proxy=https://username:password@host:port/ 

For apt,software center & etc;
edit /etc/apt/apt.conf.d/80proxy (if its not exist create it) and add the following lines

Acquire::http::proxy "http://username:password@host:port/";
Acquire::ftp::proxy "ftp://username:password@host:port/";
Acquire::https::proxy "https://username:password@host:port/";
Related Question