RHEL8系列更新镜像yum源为腾讯云yum源

2021-07-26 14:17:35 浏览数 (1)

配置方法

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

0 人点赞