34

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:

http_proxy=http://proxy.studnet.lan:8080
ftp_proxy=ftp://proxy.studnet.lan:8080
socks_proxy=socks://proxy.studnet.lan:8080
https_proxy=https://proxy.studnet.lan:8080

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?

Иван Бишевац
  • 2,031
  • 6
  • 20
  • 29

2 Answers2

16

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.

green
  • 14,240
  • 8
  • 41
  • 64
  • 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 04 '13 at 22:25
  • Glad it worked. :) – green Feb 05 '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
  • 2
    When I do `env | grep proxy` I get the same results as op but `/etc/environment` is empty. How do I find those variables? – steoiatsl Nov 28 '16 at 01:54
  • Life saver! It took me a day to find the variables in `/etc/environment`. – Alexander Haroldo da Rocha Mar 05 '20 at 10:28
7

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.

tonymke
  • 194
  • 4
  • 2
    You are right, it removes. Even better I don't need to restart computer, just to log off and then log on. – Иван Бишевац Feb 04 '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 03:08