且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CentOS7配置epel镜像并安装更新

更新时间:2022-04-10 21:55:17

 参考

阿里巴巴开源镜像站-OPSX镜像站

简介

EPEL (Extra Packages for Enterprise Linux), 是由 Fedora Special Interest Group 维护的 Enterprise Linux(RHEL、CentOS)中经常用到的包。

在配置之前先备份好原文件执行

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

CentOS7配置epel镜像并安装更新CentOS7配置epel镜像并安装更新

下载新repo 到/etc/yum.repos.d/

安装 epel 配置包

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

CentOS7配置epel镜像并安装更新CentOS7配置epel镜像并安装更新


将 repo 配置中的地址替换为阿里云镜像站地址

sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

CentOS7配置epel镜像并安装更新

执行yum install epel-release -y 安装更新

yum install epel-release -y

CentOS7配置epel镜像并安装更新CentOS7配置epel镜像并安装更新

完成

CentOS7配置epel镜像并安装更新