When I remove proxy from System/Network and apply it system wide it still remains when working in console. When I run:

env | grep proxy

it prints:


I could remove it with:

unset http_proxy
unset ftp_proxy
unset socks_proxy
unset https_proxy

but it's not permanent, when I reopen terminal these proxy variables are again setted.

How to remove them permanently?

  • "When I remove proxy from System/Network" Do you mean emptying the text boxes or changing the dropdown menu to "none"?
    – jackweirdy
    Feb 3 '13 at 19:57
  • @jackweirdy, changing dropdown menu to none. Feb 3 '13 at 21:46

Be sure to change the method dropdown from "manual" to "none". This will erase everything - you may need to restart the machine after doing this.

  • 2
    You are right, it removes. Even better I don't need to restart computer, just to log off and then log on. Feb 4 '13 at 22:05
  • Very handy. My proxy settings from Charles Proxy seemed to get "stuck" even after i closed the session and quit the program. I did this (using gsettings on the command line instead of the Network Manager proxy gui: gsettings set org.gnome.system.proxy mode 'none' , logged off and on and the http_proxy variable was unset for good. Thanks!
    – yuvilio
    Jan 28 '14 at 3:08

Make sure that those variables are not declared in any of the below files:

  • ~/.bashrc
  • /etc/bash.bashrc
  • /etc/environment

If they are, it'd be better if you remove those lines.

However, if you're unable to find them, then put the unset lines you've mentioned in your ~/.bashrc file.

  • You are right, they are in /etc/environment. I found solution for another problem I had with proxy. It's username and password for proxy. I couldn't use wget or ruby gem installing through proxy, because of authentication error. I just wrote settings in format: username:password@proxy.example.com for http_proxy, https_proxy and it works now. Thanks man, you saved me a lot of nerves :) Feb 4 '13 at 22:25
  • Glad it worked. :)
    – green
    Feb 5 '13 at 11:33
  • Thank you so much :D i got these settings into /etc/environment. I usually use .bashrc so didn't figure how much files are interfering that.
    – m3nda
    Jun 22 '15 at 13:35
  • 1
    When I do env | grep proxy I get the same results as op but /etc/environment is empty. How do I find those variables? Nov 28 '16 at 1:54
  • Life saver! It took me a day to find the variables in /etc/environment. Mar 5 '20 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.