Environment variables#
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 .bashrc
or .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.
Or /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: /etc/environment
).
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).
Package managers#
Since you are using awesome tools like zypper (openSUSE) or pacman (ArchLinux) you will probably don't care about the following paragraph.
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:
Git#
You can configure proxy usage with a git command:
This will generate the following lines in your ~/.gitconfig
:
Curl#
Normally, curl use http_proxy
environment variable but you can force it to use another proxy in the command with the -x
parameter:
You can also specify a proxy inside the ~/.curlrc
file:
Wget#
Wget may use http_proxy
environment variable but that not always works.
So /etc/wgetrc
or ~/.wgetrc
can be configured with the following lines: