EPEL

📂 文件列表

状态: | 上次更新时间: | 更新源: | 镜像大小:


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

以 CentOS 7(CentOS 8 同样适用)为例,首先安装 epel-release:

sudo yum install epel-release
              

编辑 /etc/yum.repos.d/epel.repo,在 mirrorlist= 和 metalink= 开头行前面加 # 注释掉,并将 baseurl= 开头行取消注释(若已被注释),替换相应字符串。可用如下命令进行替换:

sudo sed -e 's!^metalink=!#metalink=!g' \
         -e 's!^#baseurl=!baseurl=!g' \
         -e 's!download\.fedoraproject\.org/pub/epel!mirrors.jxust.edu.cn/epel!g' \
         -e 's!download\.example/pub/epel!mirrors.jxust.edu.cn/epel!g' \
         -i /etc/yum.repos.d/epel*.repo
              

修改结果如下:(仅供参考,不同版本可能不同)

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=http://mirrors.jxust.edu.cn/epel/7/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=http://mirrors.jxust.edu.cn/epel/7/$basearch/debug
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place it's address here.
baseurl=http://mirrors.jxust.edu.cn/epel/7/source/tree/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1