Set System-Wide Proxy settings on CLI
We will add a shell script file under /etc/profile.d/proxy.sh. This will ensure the settings apply to all logged-in users.
Populate your proxy values.sudo nano /etc/profile.d/proxy.sh
Add other IPs you want to exclude from proxy to NO_PROXY & no_proxy environment variable.# set proxy config via profie.d - should apply for all users
#
export http_proxy="http://10.10.1.10:8080/"
export https_proxy="http://10.10.1.10:8080/"
export ftp_proxy="http://10.10.1.10:8080/"
export no_proxy="127.0.0.1,localhost"
# For curl
export HTTP_PROXY="http://10.10.1.10:8080/"
export HTTPS_PROXY="http://10.10.1.10:8080/"
export FTP_PROXY="http://10.10.1.10:8080/"
export NO_PROXY="127.0.0.1,localhost"
Make it executable.
Source the file to start using the proxy settings, or alternatively logout and back in.sudo chmod +x /etc/profile.d/proxy.sh
Confirm:$ source /etc/profile.d/proxy.sh
Set proxy for APT package manager$ env | grep -i proxy
The above settings will work for Applications and command-line tools. If you want to set proxy only for the APT package manager, configure like below.
Replace 10.10.1.10 with the correct IP address for your proxy servers. If Authentication is required, set like this.$ sudo nano /etc/apt/apt.conf.d/80proxy
Acquire::http::proxy "http://10.10.1.10:8080/";
Acquire::https::proxy "https://10.10.1.10:8080/";
Acquire::ftp::proxy "ftp://10.10.1.10:8080/";
Ręczne odpalenie proxy na czas sesji:Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>/";
dla http
oraz dla httpsexport http_proxy='http://194.181.104.48:3128'
export https_proxy='https://194.181.104.48:3128'[