Lot of programs (such as wget, curl, pacman, ...) use environment variables to determine the proxy of a given protocol.
Environment variables can be added per user in their
.zshrc shell profile file with something like
export KEY=value. The advantage is that variables can be used in order to avoid repeating the same proxy several times.
/etc/environment file stores the system-wide variables initialized upon user login. Or you can use
/etc/syconfig/proxy under openSUSE.
To add proxy settings one time for everyone, you can execute the following script with sudo privilege (because you need to write into a system file:
Proxy settings on GNOME3#
Some other graphical programs (such as Chromium or Rhythmbox) ignore those environment variables and use gnome (GTK3) settings. These settings can be modified through the gnome-control-center front end and also through gsettings (see the example below).
gsettings set org.gnome.system.proxy mode 'manual'
But users of apt-get or aptitue will need an additional step to use their package manager working with a proxy. They will need to edit
/etc/apt/apt.conf.d/proxy and include the following lines:
You can configure proxy usage with a git command:
$ git config --global http.proxy http://proxy.example.org:8080
This will generate the following lines in your
Normally, curl use
http_proxy environment variable but you can force it to use another proxy in the command with the
$ curl -x http://proxy.example.org:8080 http://myurl.example.org
You can also specify a proxy inside the
proxy = proxy.example.org:8080
Wget may use
http_proxy environment variable but that not always works.
~/.wgetrc can be configured with the following lines:
http_proxy = http://proxy.example.org:8080