1. 备份

  1. # 如有配置其他epel源
  2. mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
  3. mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

2. 下载新repo

下载epel到/etc/yum.repos.d/。

  1. 安装 epel 配置包。 ```bash

    RHEL 8

    yum install -y https://mirrors.cloud.tencent.com/epel/epel-release-latest-8.noarch.rpm

RHEL 7

wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo

RHEL 6

wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-6.repo

RHEL 5

wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-5.repo

  1. 2. repo 配置中的地址替换为阿里云镜像站地址。
  2. ```bash
  3. sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.cloud.tencent.com|' /etc/yum.repos.d/epel*
  4. sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

3. 更新缓存

  1. yum clean all
  2. yum makecache