下载163的repo文件

1
2
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

备份CentOS自带的源,用mv修改一下文件名就行,我没备份直接删了…

1
mv CentOS-Base.repo CentOS-Base.repo.bak

把刚刚下载的163源repo文件重命名为系统自带源

1
mv CentOS6-Base-163.repo CentOS-Base.repo

更新源

1
2
3
yum clean all
yum makecache
yum update

OK 可以用了,可以测试下

1
yum -y install vim
1
2
3
4
5
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Package 2:vim-enhanced-7.2.411-1.8.el6.x86_64 already installed and latest version
Nothing to do

说明可以用了