1、首先备份/etc/yum.repos.d/CentOS-Base.repo
1 |
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup |
2、根据CentOS版本选择操作
CentOS-5
1 2 |
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo yum makecache |
CentOS-6
1 2 |
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo yum makecache |