1 Enter the directory /etc/yum.repos.d/
2 Backup the original image file
mv CentOS-Base.repo CentOS-Base.repo.bak
3 Download the new CentOS-Base.repo
Execute any of the following commands:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4 Clear the original yum cache
yum clean all
5 Generate cache
yum makecache