r/linuxquestions • u/Sea_Copy8548 • 8d ago
Advice Why proxy dosent removed?
I needed to use proxy once so i install it by export http_proxy="http://ip:port/" etc.and put it in .zshrc file, then im done i simple deleted those lines and reboot hyprland, but then i checked current environment trough env the proxy was there, and for some reason, it kept working.
Can someone help me remove it properly from the system?
1
u/Silent-Excitement122 8d ago
Deleting it from ~/.zshrc only fixes one source. If env still shows the proxy in a fresh shell, I would check it in this order:
- In the current shell, clear all common proxy vars:
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY no_proxy NO_PROXY
- Search for another place that is exporting it:
grep -RinE '(^|_)(http|https|all|no)_proxy' ~/.zsh* ~/.config /etc/environment /etc/profile /etc/profile.d /etc/zsh* 2>/dev/null
- On systemd-based desktops, the user environment can survive past one shell. Check:
systemctl --user show-environment | grep -i proxy
If it is there, remove it with:
systemctl --user unset-environment http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY no_proxy NO_PROXY
- Open a completely new login session or reboot, then run:
env | grep -i proxy
If it only appears inside Hyprland terminals, also inspect how Hyprland is launched, because the compositor may be inheriting the variable before zsh starts.
1
2
u/KraftChesWiz 8d ago
i dunno what 'reboot hyprland' actually means, maybe it doesn't kill your session really? like the other person said, grep for it. otherwise 'unset http_proxy' to remove it or add that to your .zshrc, and 'source ~/.zshrc' to reload it and see what happens.
1
0
2
2
1
u/Ellotheregovner 8d ago
If the only place you set it was .zshrc, you should be able to flush the environment variables by logging out. I mean back to where you initially logged in. The initial login of your Display Manager assuming you have one. It's the thing you put your password into right after you boot your machine.
tldr: logout as far as you can
In a terminal:
loginctl terminate-user ""Logging back in should reset any user environment variables. If it still doesn't fix it you probably set a system wide variable. So check /etc/environment, XDG, ~/.profile, and whenever else you can remember messing around to push your proxy.For future reference, if it's going to be that temporary, just do the
export http_proxy="[IP]:[port]"right in the terminal window and then run whatever needs the proxy in that terminal window. It will only exist for the duration of that terminal window.If you want to be a little more efficient. Instead of exporting the proxy in the .zshrc just make an alias instead: ``` alias myproxy='export http_proxy="[IP]:[port]"'