Homebrew and apt ignore your proxy? Terminal variables, sudo and safe rollback
Your browser downloads fine, yet `brew install` or `sudo apt update` times out. Browsers read desktop proxy settings; package managers do no
Your browser downloads fine, yet brew install or sudo apt update times out. Browsers read desktop proxy settings; package managers do not. Fix it per tool and test once before making anything permanent:
- Homebrew uses curl and git under the hood, so it follows environment variables. Test with a one-off:
HTTPS_PROXY=http://127.0.0.1:<port> brew update. If that works, add the export to your shell profile. - APT runs as root, and
sudodrops most of your environment.sudo apt updatewill not see the variable you exported. Test withsudo apt -o Acquire::https::Proxy="http://127.0.0.1:<port>" update. - To make APT permanent, create a small file like /etc/apt/apt.conf.d/95proxy with an
Acquire::http::Proxyline. Keeping it in its own file makes rollback a singlerm. - Do not disable signature checks or swap your official sources to fix a timeout. Those are separate problems.
- Set NO_PROXY for local and internal hosts so mirrors on your LAN are not routed away.
Full guide with rollback steps: https://roxi.cc/pkgnet26.html
Written by the small team behind Roxi.
Write a comment