CentOS 6.8 yum 修改源:

Index of /centos-vault/centos/ (aliyun.com): http://mirrors.aliyun.com/centos-vault/centos/

  1. 下载新的 CentOS-Base.repo

把CentOS-Base.repo文件中的以下网址
http://mirrors.aliyun.com/centos/
http://mirrors.aliyuncs.com/centos/
http://mirrors.cloud.aliyuncs.com/centos/
修改成
http://mirrors.aliyun.com/centos-vault/centos/
把epel.repo文件中的
enabled=1修改enabled=0

cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel.repo

//编辑CentOS-Base.repo 

:%s#http://mirrors.aliyun.com/centos/#http://mirrors.aliyun.com/centos-vault/centos/#g
:%s#http://mirrors.aliyuncs.com/centos/#http://mirrors.aliyun.com/centos-vault/centos/#g
:%s#http://mirrors.cloud.aliyuncs.com/centos/#http://mirrors.aliyun.com/centos-vault/centos/#g

// 编辑epel.repo  enabled=1 改成 enabled =0
vim epel.repo .....

  1. yum makcache

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