Where is the Proxy Setting saved on Ubuntu Server 12.04? Tips, Tricks and Tutorials 25 JUN 2014

I was having annoying issues on an Ubuntu Server 12.04 which I hadn’t done the original setup of but which I had done the upgrade from 10.04 to 12.04, one of the particularly frustrating things being the fact that the server appeared to be using a proxy for all outbound connections, be it for wget calls, svn calls, or even apt-get calls. Although I cleared it out (or at least I thought I had) by making sure both apt.conf.d and wgetrc settings weren’t referring to a HTTP proxy, the problem remained unresolved.

At the end of the day, the culprit turned out to be the environment setting ($http_proxy) that was holding up the show, something I only discovered after a LOT of Google Fu. (Ubuntu Server configuration is not my everyday task, so I’m a middling power user at most).

Anyway, it turns out that from Ubuntu 11.10, which obviously carried over to Ubuntu 12.04, you have system wide settings in a couple of locations. Here are three of them whereby HTTP proxy information could be saved:

/etc/environment

The big system environment file can hold proxy information in the form of:

...
http_proxy="user:pass@my.proxy:port"
...

/etc/apt/apt.conf.d/02/proxy

The command apt has its settings in this file:

Acquire::http::proxy "http://user:pass@my.proxy:port"

/etc/wgetrc

The command wget has its settings in this file following the same format as the /etc/environment file mentioned above:

http_proxy="user:pass@my.proxy:port"

A useful little reference when you find your wget behaving very different to your apt-get, to your traceroute commands!

ubuntu black and orange logo

Related Posts:

About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don’t have time for myself any more.