Saturday, October 12, 2013

How to use proxy setting with Linux Mint



The dreaded proxy server has reared its head again. If you read my post about Linux OS for old tech you would have found me advocating Ubuntu, Elementary and Linux Mint. Unfortunately, I have found Linux Mint to be problematic if your school server uses proxy settings to get online. Ubuntu and Elementary also require changes to the network settings if you use a proxy, but this only involves a simple change in the Network Settings panel. This doesn't work in Linux Mint, the settings can be entered but will not remain saved.

So, here's the 'how to' courtesy of the askUbuntu Q&A section - if you're not keen on using terminal commands I suggest you either don't bother using Linux Mint and stick to Ubuntu or Elementary (or any other Linux distro) or swallow your fears and give this a go.

  • Use terminal to open /etc/environment using a text edit app as superuser - e.g. in terminal type sudo gedit /etc/environment     (enter password when asked)
  • Add the following lines to the text document that appears, replacing myproxy.server.com with your proxy address
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 the file, then  navigate to /etc/apt/apt.conf.d/ and create a new file there named 95proxies and include the following code (remembering to add your own proxy address in place of myproxy.server.com)
Acquire::http::proxy "http://myproxy.server.com:8080/";
Acquire::ftp::proxy "ftp://myproxy.server.com:8080/";
Acquire::https::proxy "https://myproxy.server.com:8080/";
Reboot and once you have logged in you will find that your proxy settings are in place for Network Settings, apt-get and Update manager. It's a pain but it does give you an idea about using the command line in a Linux terminal.

Additional setting (Tip provided by +Chris Readle
If you need to authenticate on your proxy, you need to stick a <username:password> in front of the proxy server address
For instance
http://myusername:mypassword@myproxy.mydomain.com:8080/


Sources askubuntu and archlinux wiki