配置方法
1. 备份(如有配置其他epel源)
代码语言:shell复制mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
2. 下载新repo 到/etc/yum.repos.d/
epel(RHEL 8)
1)安装 epel 配置包
代码语言:shell复制yum install -y https://mirrors.cloud.tencent.com/epel/epel-release-latest-8.noarch.rpm
2)将 repo 配置中的地址替换为阿里云镜像站地址
代码语言:shell复制sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.cloud.tencent.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
epel(RHEL 7)
代码语言:shell复制wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo
epel(RHEL 6)
代码语言:shell复制wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-6.repo
epel(RHEL 5)
代码语言:shell复制wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-5.repo
更新缓存
代码语言:shell复制yum clean all
yum makecache