Note: my install is a bit broken at the moment so I’m not 100% certain all of this accurate.

System Network Settings:

You can configure some system-wide proxy settings in the network system settings, but unfortunately this may not always work. The main reason is that there is no option to supply a username and password for the proxy.

Solution 1 – dconf-editor:

One solution is to use dconf-editor which allows you to manage dconf settings which is a low-level configuration system. To install it run:
    sudo apt-get install dconf-tools
You can then run the tool and edit settings which (for some reason) are not available in the standard network proxy settings.
Solution 2 – /etc/environment
The other way is to edit /etc/environment and change the environment variables. This file “stores the system-wide variables [which are] initialised upon boot”:

    sudo gedit /etc/environment &

Add the appropriate proxy details:
http_proxy=http://:@:/
https_proxy=http://:@:/
ftp_proxy=http://:@:/
no_proxy=”localhost,127.0.0.1,localaddress,.localdomain.com”

Apparently some programs only look an upper or lower case variables, so you should include both:
HTTP_PROXY=http://:@:/
HTTPS_PROXY=http://:@:/
FTP_PROXY=http://:@:/
NO_PROXY=”localhost,127.0.0.1,localaddress,.localdomain.com”

Aptitude:

We still have a small problem: to get a proxy working for aptitude (so you can ‘apt-get’ in terminal and also use the Software manager), you need to manually edit /etc/apt/apt.conf as aptitude doesn’t respect the system proxy. To do this:
    sudo gedit /etc/apt/apt.conf &

You will then need to add the required proxies:

Acquire::http::proxy “http://:@:/”;
Acquire::ftp::proxy “ftp://http://:@:/”;

Acquire::https::proxy “http://:@:/”;

References:
Advertisements