Simple scripts to quickly set and remove system-wide proxy settings on GNU/Linux systems.
β οΈ Please read carefully before using.
- Backup your
/etc/environmentfile:sudo cp /etc/environment ~/environment.backup
Do not run these scripts using sudo.
π How to Use
- Go to the directory for your distro (e.g.,
Arch/orDebian/) - Go to the directory that your system is currently using
- Set Proxy:
./apply_proxy
Youβll be asked to enter the proxy hostname.
- Remove Proxy:
./remove_proxy
π₯οΈ If you are using KDE Plasma, enable: System Settings β Networking β Wi-Fi & Internet β Proxy β Use system proxy configuration
β οΈ If for some reason your proxy doesnt change in KDE Plasma Settings even after running scripts, or "Use system proxy configuration" option doesnt read the proxy env variables, use the KDE Specific scripts.
π Run Scripts from Anywhere
- Instead of Distro, use your current distro, Arch/ or Debian/
- If you want to use apply_proxy and remove_proxy globally, add them to your ~/.local/bin/:
mkdir -p ~/.local/bin curl https://raw.githubusercontent.com/Surya-Raghuram/Linux-Proxy/main/linux-proxy/{Distro}/apply_proxy > ~/.local/bin/apply_proxy && chmod +x ~/.local/bin/apply_proxy curl https://raw.githubusercontent.com/Surya-Raghuram/Linux-Proxy/main/linux-proxy/{Distro}/remove_proxy > ~/.local/bin/remove_proxy && chmod +x ~/.local/bin/remove_proxy
β After this, you can run apply_proxy or remove_proxy from any directory!
π What the Scripts Modify When you apply proxy, the script updates:
-
/etc/environment
- It also updates some other popular packags that are used, the packages it supports are:
- apt/ pacman
- snap
- git
- npm
β‘ Important Warnings
Modifying /etc/environment is risky. Always keep a backup.
Understand what the script does before running it.
If something goes wrong, it's on you β use responsibly.
- Add support for Arch-based distros (Manjaro, EndeavourOS, Arch Linux)
- Add support for Fedora/RHEL/CentOS (DNF/YUM proxy configs)
- Add GNOME/KDE desktop environment proxy integration
- Export proxy settings in shell configs (~/.bashrc, ~/.zshrc, etc.)
- Add dry-run mode + rollback option for safety
- Provide
.deband.rpmpackages for easier installation
π’ Suggestions or Issues? Feel free to create an issue on this repository.