CentOS 如何加入第三方 Yum 套件库: EPEL

EPEL 的全称为“Extra Packages for Enterprise Linux”,是由 Fedora 社群打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux、Rocky Linux、Oracle Linux...等提供高品质套件库的专案。装了 EPEL 之后,等于添加了一个资源丰富的第三方套件库。

安装 EPEL 套件库

直接安装 EPEL 看看:

$ yum install epel-release

幸运的话,你的系统中有启用 CentOS 官方的 extras 套件库,里面就有 EPEL 的套件,直接安装就会成功!

依下面的指令可查看系统中的套件库,里面就有 extras 套件库:

$ yum repolist
 Loaded plugins: fastestmirror, refresh-packagekit
 Loading mirror speeds from cached hostfile
 repo id  repo name          status
 base     CentOS-6 - Base     6,713
 extras    CentOS-6 - Extras        47
 updates  CentOS-6 - Updates  1,193
 repolist: 7,953

如果上述的步骤安装失败,可自行下载 rpm 来安装:

# CentOS/RHEL 5.x
$ wget https://dl.fedoraproject.org/pub/archive/epel/5/x86_64/epel-release-5-4.noarch.rpm
$ rpm -ivh epel-release-5-4.noarch.rpm

# CentOS/RHEL 6.x
$ wget https://dl.fedoraproject.org/pub/archive/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -ivh epel-release-6-8.noarch.rpm

# CentOS/RHEL 7.x
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ rpm -ivh epel-release-latest-7.noarch.rpm

# CentOS/RHEL 8.x
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
$ rpm -ivh epel-release-latest-8.noarch.rpm

# CentOS/RHEL 9.x
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
$ rpm -ivh epel-release-latest-9.noarch.rpm

如果上述的档案连结失效了,可至 EPEL 的套件下载网页,依版本及目录结构去寻找相对应的档案来安装,并不难找。

安装好 epel-release-*.rpm 之后,再次查看系统中的套件库:

$ yum repolist
 Loaded plugins: fastestmirror, refresh-packagekit
 Loading mirror speeds from cached hostfile
 repo id  repo name                                  status
 base     CentOS-6 - Base                             6,713
 epel      Extra Packages for Enterprise Linux 6 - x86_64  12,581
 extras   CentOS-6 - Extras                              47
 updates  CentOS-6 - Updates                          1,193
 repolist: 20,534

看到多出了 epel 与一万多个套件,这样就小功告成了!

EPEL 可用的套件

参考网页

  1. No comments yet.

  1. No trackbacks yet.

return top

%d 位部落客按了赞: