CentOS修改yum更新源

转到源目录:
cd /etc/yum.repos.d/

备份默认的更新源
mv CentOS-Base.repo CentOS-Base.repo.backup

编辑yum.conf文件
vim /etc/yum.conf
在末尾添加:

proxy=http://user:[email protected]:8080
proxy=https://user:[email protected]:8080
proxy=socks://user:[email protected]:8080
proxy=ftp://user:[email protected]:8080

export变量

export http_proxy=http://user:[email protected]:8080
export https_proxy=https://user:[email protected]:8080

按照自己的版本下载源,我是CentOS 7,使用命令:
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

运行以下命令生成缓存:
yum clean all
yum makecache

Over

你可能感兴趣的:(CentOS修改yum更新源)