1、首先备份/etc/yum.repos.d/
CentOS-Base.repo
- mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、根据CentOS版本选择操作
CentOS-5
CentOS-5
- wget http://mirrors.163.com/.help/CentOS5-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
- yum makecache
CentOS-6
- wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
- yum makecache
- CentOS Linux交流群:177361427,欢迎博客读者们加入交流
转载于:https://blog.51cto.com/dongyahui/736936