Press "Enter" to skip to content

为yum配置代理

How to enable Proxy Settings for Yum Command on RHEL / CentOS Servers

编辑yum的配置文件:/etc/yum.conf


proxy=http://<Proxy-Server-IP-Address>:<Proxy_Port>
proxy_username=<Proxy-User-Name>
proxy_password=<Proxy-Password> 

还有一种配置方法:

在 “/etc/environment” 或者 “/root/.bashrc” 文件里面配置变量

export http_proxy=http://{Proxy-User-Name}:{Proxy-Password}@<Proxy-Server-IP-Address>:<Proxy-Port>
export https_proxy= http://{Proxy-User-Name}:{Proxy-Password}@<Proxy-Server-IP-Address>:<Proxy-Port>
export no_proxy=127.0.0.1,localhost

然后执行命令

source /etc/environment

这个配置会将你整个系统都使用代理。

参考资料:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注