二. 先备份本地源/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
三.切换到目录/etc/yum.repos.d下载163的repo源文件, (http://mirrors.163.com/.help/centos.html)
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
四. 改名本地yum源为要替换的163源
mv /etc/yum.repos.d/CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
五. 生成缓存
yum clean all
yum makecache
接下来,访问测试即可!更换别的源,举一反三即可!
原文地址:http://blog.51cto.com/13520779/2089568