開發測試環境,epel源被更改導致:
yum-y?install git ? ? ? ? ?( 安裝gitl客戶端的時候報錯 )
Error: Package: perl-Git-1.8.2.3-1.el5.x86_64 (epel) ? ?( 很明顯epel源是el5,所以導致無法獲取到源 )
Requires:?perl(:MODULE_COMPAT_5.8.8)
Error:?Package:?git-1.8.2.3-1.el5.x86_64?(epel)
Requires: libcurl.so.3()(64bit)
You?could?try?using?--skip-broken?to?work?around?the?problem
You?could?try?running:?rpm?-Va?--nofiles?--nodigest
1. 首先確認你的系統版本
首先通過以下命令確認你的CentOS 版本
$ cat /etc/redhat-release
CentOS release 6.4 (Final)
現在從上面的地址下載CentOS 版本所對應的EPEL 的版本
$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
3. 安裝EPEL
rpm -ivh epel-release-6-8.noarch.rpm
5. 檢查EPEL 源
安裝好EPEL 源后,用yum 命令來檢查是否添加到源列表
# yum repolist
6.如果報錯如下
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
原因是某epel的鏡像節點zuo妖或者宕機了,也可能是CA信任列表過期導致無法正確獲取epel鏡像站點;
所以先考慮更新CA可信任列表:
yum upgrade ca-certificates --disablerepo=epel ? ?(更新完,yun repolist 就可以檢查到源了)
如果還不行,就禁止使用HTTPS協議訪問epel的鏡像服務器:
sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo
再不行,就干脆不要用epel的鏡像節點,從他的基礎節點更新:
編輯/etc/yum.repos.d/epel.repo,去掉baseurl前面的#,在mirrorlist前加上#