2

I had installed a proxy software (cntlm) on my machine. It sets the environment variable http_proxy to 127.0.0.1:3128. Now I've uninstalled the program using apt-get remove cntlm.

However I'm able to see the http_proxy variable:

env | grep proxy

Gives me:

http_proxy=http://127.0.0.1:3128/
https_proxy=http://127.0.0.1:3128/
no_proxy=127.0.0.1, localhost

I've tried doing a recursive grep on ~ and /etc but it doesn't show anything:

grep -ri https_proxy ~
grep -ri https_proxy /etc

The interesting thing is that other terminals such as LXTerminal doesn't have this problem. It only occurs in gnome-terminal.

I've also tried renaming the bash startup script files:

mv .bashrc .bashrc~ 
mv .profile .profile~
mv .bash_profile .bash_profile~

By renaming, the stuff inside these files (and any linked files) won't be sourced. However, this doesn't help either.

How do I go about debugging this problem?

I've already gone through this question and it doesn't help.

  • Is this happening even in a fresh gnome-terminal as well? – Dan Cornilescu Jun 24 '15 at 15:57
  • Also check the system and your *rc files for sourcing app-related scripts, not just for directly setting the env vars. Typically they're added at the end. – Dan Cornilescu Jun 24 '15 at 15:59
  • If you are on a gnome-based system, then also check your dconf settings, either under Settings --> Network --> Network proxy or via the terminal using gsettings list-recursively org.gnome.system.proxy – steeldriver Jun 24 '15 at 16:26
3

Running gsettings reset-recursively org.gnome.system.proxy fixed the problem.

There are two ways to define proxy settings:

  1. Manually set the http_proxy environment variable in /etc/environment or your bash profile.
  2. Define it in gnome system settings.

I had not set the environment variable manually which is why recursive grep didn't find anything. gnome-terminal was reading gnome system settings and automatically defining the variable.

See this post for more details on various ways of defining proxy settings.

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.