-------讲系统自带的yum源配置文件备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.old
-------进入yum源配置文件所在的文件夹
cd /etc/yum.repos.d/
-------下载163镜像源
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
(
如果提示wget:unable to resolve host address ‘mirrors.163.com’,则用root登录linux并更改/etc/resolv.conf,修改内容为下:
修改内容为下
nameserver 8.8.8.8 #google域名服务器
nameserver 8.8.4.4 #google域名服务器
)
------运行yum makecache生成缓存
yum makecache
------更新yum
yum -y update