yum
- 配置yum源:在/etc/yum.repos.d/目录下创建yum源文件
- 配置yum代理:
echo "proxy=http://proxy.example.com:8080" >> /etc/yum.conf
全局配置
vi ~/.bashrc
export http_proxy=http://proxy.example.com:8080/
export https_proxy=http://proxy.example.com:8080/
source ~/.bashrc
wget
vi /etc/wgetrc
http_proxy=http://proxy.example.com:8080/
https_proxy=http://proxy.example.com:8080/
ftp_proxy=http://proxy.example.com:8080/
git
vi ~/.gitconfig
proxy=http://proxy.example.com:8080/
snap
snap set system proxy.http=http://proxy.example.com:8080/
docker
mkdir -p /etc/systemd/system/docker.service.d
touch /etc/systemd/system/docker.service.d/proxy.conf
vi /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:8080/"
Environment="HTTPS_PROXY=http://proxy.example.com:8080/"
Environment="NO_PROXY=localhost,127.0.0.1,example.com"
systemctl daemon-reload
systemctl restart docker