备份系统原 yum
源
# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
替换 yum
源
# wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
替换 EPEL
源 - 可选
# wget -O /etc/yum.repos.d/epel.repo https://file.cnxiaobai.com/Linux/Yum/epel.repo
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
清理缓存
# yum clean all
生成新的缓存
# yum makecache
更新系统
# yum -y update
赞