1. /etc/yum.conf 添加 proxy=http://username:password@IP地址:端口/
2. /etc/profile 文件 添加以下内容
http_proxy=http://username:password@IP地址:端口/
ftp_proxy=http://username:password@IP地址:端口/
export http_proxy
export ftp_proxy
3. 配置 163 的yum
备份/etc/yum.repos.d/CentOS-Base.repo
下载 163的CentOS-Base.repo
http://mirrors.163.com/.help/CentOS7-Base-163.repo
替换原来的CentOS-Base.repo
yum clean all
yum makecache
代理设置完毕。