How to Change the System Proxy Settings via the Terminal in Linux Mint (ubuntu)

I use Linux Mint and I frequently change my proxy settings. This is because my wonderful daughter like to watch TV programs from Sweden and I need to access the web sites through a Swedish IP address. It gets kinda boring after a while having to enter the proxy settings each time so I created a little script to toggle the proxy settings.

The part that adds the proxy:
The parts in bold are the important stuff. That should be the value to your own proxy.

 gsettings set org.gnome.system.proxy.socks host 'localhost'
 gsettings set org.gnome.system.proxy.socks port 9997
 gsettings set org.gnome.system.proxy mode 'manual'

The part that disable the proxy:

 gsettings set org.gnome.system.proxy mode 'none'

Works like a charm and there is no need to enter through the network proxy GUI every time.

Please note that you need to restart your terminal windows for the change to take affect in them (do export | grep -i proxy and change the variables if you don’t want to restart the terminal window(s))

 
Cheers
/jima

Leave a Reply

Your email address will not be published. Required fields are marked *