Linux資源庫(repository)

from https://ephrain.net/linux-%E5%9C%A8-centos-7-%E4%B8%8A%E5%8A%A0%E5%85%A5-epel-repository-%E4%BE%86%E5%AE%89%E8%A3%9D-atop/

. 使用 yum 安裝 epel-release
網頁上常見的作法是用 wget 去抓下 epel-release 相關的 RPM 檔,再用 yum 安裝…
不過以我的例子來說,直接用 yum install epel-release,
它就為自動抓下正確的 RPM 檔安裝了,省去 wget 的功夫:
sudo yum -y install epel-release




from https://www.astralweb.com.tw/under-centos-environment-expand-the-repository-by-install-epel/



在Linux系統上有所謂的資源庫(repository),這就像是一份清單,清單上紀錄著甚麼資源可以去哪邊下載更新(例如各種不同版的Linux應用程式),所以今天為甚麼要擴充呢?

主要原因有兩個:
一、作業系統通常不會頻繁更新,想要安裝新版的軟體時;
二、軟體太新了,相比較起來舊版的作業系統不一定支援,但依然想要測試
不過多數人都了解,Centos是Linux開源軟體,所以其實可擴充的版本庫遠不只一種,介紹Epel是因為一個比較方便使用,且提供的資源版本也足夠大多數人使用,例如說多數人熟知的PHP,Mysql,Nginx。

安裝可能會遇到一個狀況是,CentOS的Extras repository是停用(disabled)的。

如果是啟用的:

Centos指令
sudo yum install epel-release

如果是停用的,會比較麻煩,需要查詢你的Centos版本去安裝對應的Epel版本:

Centos指令
cat /etc/redhat-release //查詢你的Centos版本,對應查到的版本,選擇:


//CentOS and Red Hat Enterprise Linux 5.x
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
sudo rpm -Uvh epel-release-5*.rpm


//CentOS and Red Hat Enterprise Linux 6.x
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm


//CentOS and Red Hat Enterprise Linux 7.x
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
sudo rpm -Uvh epel-release-7*.rpm
如果連結找不到,可能是版本有異動更新了,可以依這個連結目錄去找到相對應的版本:

http://dl.fedoraproject.org/pub/epel/




留言

熱門文章