1)cd /etc/yum.repos.d/
2)wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo //根据自己的版本去更改源
// centos 7 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3)yum clean all
4)yum makecache