解决
进入目录,备份
1 | cd /etc/yum.repos.d/ |
换源
1 | wget http://mirrors.aliyun.com/repo/Centos-7.repo |
除系统 yum 缓存并生成新的 yum 缓存
1 | yum clean all # 清除系统所有的yum缓存 |
安装 epel 源
1 | yum list | grep epel-release |
使用阿里开源镜像提供的 epel 源
1 | wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo |
其他
CentOS 8
1 | wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo |
或
1 | curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo |
CentOS 7
1 | wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo |
或
1 | curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo |
CentOS 6
1 | wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo |
或
1 | curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo |