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
本文详细指导如何在Linux系统中为yum、wget、git和Docker设置全局代理,包括编辑配置文件和环境变量,确保网络请求通过指定的http://proxy.example.com:8080代理。

2190

被折叠的 条评论
为什么被折叠?



