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 位部落客按了讚: