原文链接:http://blog.csdn.net/xyang81/article/details/51476498
1、下载CentOS相应发行版的镜像
查看发行版本:
shell> cat /etc/centos-release
如下载CentOS7的镜像:
shell> cd /opt
shell> wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
2、备份默认源,并拷贝163源到源管理目录
shell> mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
shell> cp /opt/CentOS7-Base-163.repo /etc/yum.repos.d/
3、生成缓存
yum clean all
yum makecache