国内yum源安装
1. 阿里云镜像源
CentOS 7
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
2. 163镜像源
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
验证:
清除yum的缓存、头文件、已下载的软件包等等
1 | yum clean all |
重建yum缓存,看是否有报错。
1 | yum makecache |
查看已启用的镜像源
1 | yum repolist all |