If http_proxy returns in the next terminal, find who supplied it. Another unset at the end of .bashrc can hide the value for one launch while leaving its source active elsewhere.

  1. Identify the failing launch. Is it an interactive login shell, a non-login terminal, or a non-interactive job? Bash invoked as sh follows different rules too.
  2. Follow that startup path. An interactive login shell reads /etc/profile and then the first available user file among ~/.bash_profile, ~/.bash_login and ~/.profile. An interactive non-login shell normally reads ~/.bashrc. A login file may source it explicitly. For non-interactive Bash, account for BASH_ENV where applicable.
  3. Find the assignment. Search those files and the files they source for the variable name and old proxy hostname. Include relevant /etc/profile.d snippets and uppercase as well as lowercase names.
  4. If startup did not assign it, trace the parent. The shell inherits an environment from its terminal, login session, service manager or development tool. A long-lived parent can retain the old value after you edit a shell file.

For PAM-based logins, check /etc/environment as well. Correct the owning source and start the affected launch path again, refreshing the parent configuration when needed. Keep searches local: startup files and environment dumps can contain credentials. The result to verify is the value inherited by the intended command, rather than the last file that managed to unset it.

Related articles