1. 备份原来的yum源

$sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo-backup

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

2.设置aliyun的yum源

$sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.添加EPEL源

$sudo wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

 

4.清理缓存,生成新缓存,执行yum系统更新

$sudo yum clean all

$sudo yum makecache

$sudo yum update(可选)

 

参考文章:

https://blog.csdn.net/zytbft/article/details/81166345

https://yq.aliyun.com/articles/691851?spm=a2c4e.11155472.0.0.42e22088vZPR8y

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄