Systemwide proxy settings in ubuntu

Solved it finally:

(Follow the steps serially)

1. For gtk3 programs such as rhythmbox and online accounts:

First you need to enter proxy settings in network settings (along with authentication):

enter image description here

Then apply system wide.

2. For apt,software center etc

edit the file /etc/apt/apt.conf

And then replace all the existing text by 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/";

3. Environment variables

edit the file /etc/environment

And then add the following lines after PATH="something here"

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

That's all..


To download packages by wget proxy have to be setup in /etc/environment, and to download packages by apt-get proxy have to be setup in /etc/apt/apt.conf


That’s not all, of course. Some more programs (npm, curl and git):

npm config set proxy $HTTP_PROXY
npm config set https-proxy $HTTPS_PROXY
npm config set strict-ssl false
echo "proxy = $HTTP_PROXY" > ~/.curlrc
echo "noproxy = $NO_PROXY" >> ~/.curlrc
git config --global http.proxy $HTTP_PROXY
git config --global https.proxy $HTTPS_PROXY

For Maven, edit ~/.m2/settings.xml. IntelliJ does not seem to pick up the global config either.

Tags:

Proxy

14.04