下载wget
进入目录
把原来的源干掉
换成阿里源
清除原始缓存记录
使用新缓存,新源的记录
然后源就变回来啦!
[root@tang opt]# yum install -y wget
[root@tang opt]# cd /etc/yum.repos.d/
[root@tang yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo_bak
[root@tang yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@tang yum.repos.d]# yum clean all
[root@tang yum.repos.d]# yum makecache