1. 备份本地源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
  1. 更新国内源
针对国内源有很多,个别咱们抉择阿里或者163
阿里:http://mirrors.aliyun.com/rep...
163:http://mirrors.163.com/.help/...

我这里应用阿里

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  1. 清空yum缓存
yum clean all
  1. 重建yum缓存
yum makecache
  1. 更新yum
yum upgrade