EPEL 是什么?
EPEL (Extra Packages for Enterprise Linux,企業版Linux的額外軟件包) 是Fedora小組維護的一個軟件倉庫項目,為RHEL/CentOS提供他們默認不提供的軟件包。這個源兼容RHEL及像CentOS和Scientific Linux這樣的衍生版本。
我們可以很容易地通過yum命令從EPEL源上獲取上萬個在CentOS自帶源上沒有的軟件。EPEL提供的軟件包大多基於其對應的Fedora軟件包,不會與企業版Linux發行版本的軟件發生沖突或替換其文件。
更多關於EPEL 項目的細節可以到以下網站獲取:https://fedoraproject.org/wiki/EPEL
在文本中,我將展示在CentOS下如何安裝EPEL源
在CentOS 上安裝EPEL
要想安裝EPEL,我們先要下載EPEL的rpm安裝包。
CentOS/RHEL下的6.x和5.x版本下載頁面如下
http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.htmlhttp://download.fedoraproject.org/pub/epel/5/i386/repoview/epel-release.html
以上網址可能會被重定向到特定的鏡像站而加快下載速度。這個頁面包含可以直接獲取到rpm包的下載鏈接。直接的下載鏈接如下:
http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpmhttp://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
根據你的CentOS 版本來選擇正確的下載地址。
請注意EPEL 的安裝包是獨立編譯的,所以它可以安裝在32位和64位系統中。
1. 確認你的CentOS 的版本
首先通過以下命令確認你的CentOS 版本
$ cat /etc/redhat-release CentOS release 6.4 (Final)
2. 下載EPEL 的rpm 安裝包
現在從上面的地址下載CentOS 版本所對應的EPEL 的版本
$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
3. 安裝EPEL
通過以下命令安裝EPEL 軟件包
$ sudo rpm -ivh epel-release-6-8.noarch.rpm
或
$ sudo rpm -ivh epel-release*
5. 檢查EPEL 源
安裝好EPEL 源后,用yum 命令來檢查是否添加到源列表
# yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.vonline.vn * epel: buaya.klas.or.id * extras: centos-hn.viettelidc.com.vn * updates: mirrors.fibo.vn repo id repo name status base CentOS-6 - Base 6,381 epel Extra Packages for Enterprise Linux 6 - x86_64 10,023 extras CentOS-6 - Extras 13 nginx nginx repo 47 updates CentOS-6 - Updates 1,555 repolist: 18,019
EPEL已經在repo 后列出,並且顯示提供了上萬個軟件包,所以EPEL 已經安裝到你的CentOS了。
EPEL源的配置安裝到了 /etc/yum.repos.d/epel.repo 文件。
現在來試一下從EPEL 獲取軟件包
$ sudo yum install htop
引用:https://linux.cn/article-2324-1.html
引用:http://www.binarytides.com/setup-epel-repository-centos/