yum 安裝報錯:*epel: mirrors.aliyun.comError: xzcompressionnot available

環境背景:epel源下載地址:web

http://mirrors.aliyun.com/Centos內核內核版本[root@nfs01 ~]# uname -r2.6.32-642.el6.x86_64==集羣架構批量執行shell

yum install ipvsadm -y緩存

報錯:服務器

*epel: mirrors.aliyun.comError: xzcompressionnot available架構

 

[root@web01 tmp]# cat /server/scripts/plzs.shyum install -y ipvsadm[root@m01 ~]# ansible oldboy -m shell -a "/bin/sh/server/scripts/plzs.sh"172.16.1.31 | FAILED | rc=1 >>Loaded plugins: fastestmirror, securitySetting up Install ProcessLoading mirror speeds from cached hostfile * epel: mirrors.aliyun.comError:xz compression not available…………此處略=spa

追尋錯誤根源:server

 相同epel源下的其餘機器執行

yum install ipvsadm -y正常 xml

猜測:本機epel執行過的yummakecache致使epel源改變二、更新本機全部軟件版本:ip

 

[root@nfs01 ~]# yum updateLoaded plugins: fastestmirror, securitySetting up Update ProcessLoading mirror speeds from cached hostfile * epel: mirrors.aliyun.comepelci

| 4.3 kB    00:00    Error: xz compression not available

結論:一樣的問題,而且下載其餘軟件一樣報錯

經過錯誤基本判斷出錯方向

*epel: mirrors.aliyun.comError: xz compression not available

(epel源不符,xz壓縮不可用)

猜測結論

 yum中「repomd.xml」做用,是提供了「更新.xml.gz」的下載信息和SHA校驗值。若執行yum makecache將服務器上的軟件包本地緩存,後將*.xml中的檢驗值更改,致使yum下載校驗出錯

 

驗證結論:

方法:找出本地服務器中的全部repomd.xml尾的文件和正常環境中repomd.xml進行比對

 

[root@web01 ~]# find / -type f -name "*repomd.xml*"

/var/cache/yum/x86_64/6/epel/repomd.xml

/var/cache/yum/x86_64/6/base/repomd.xml

/var/cache/yum/x86_64/6/extras/repomd.xml

/var/cache/yum/x86_64/6/updates/repomd.xml

 驗證結果:多處存在改動

diff repomd.xml /var/cache/yum/x86_64/6/epel/repomd.xml

3c3<  <revision>1489581919</revision>--->  <revision>1489581221</revision>8,11c8,11<    <checksumtype="sha256">086a4493b8fff841a620dc106fbc01ee1cd706fdee44c20a61f96ed18f0b521d</checksum><    <locationhref="repodata/086a4493b8fff841a620dc106fbc01ee1cd706fdee44c20a61f96ed18f0b521d-comps-el6.xml"/><    <timestamp>1489582011</timestamp><    <size>1319051</size>---略=============================================================================

執行解決方法:

1) 備份後將比對出入文件進行刪除

\rm/var/cache/yum/x86_64/6/{base,extras,updates,epel}/repomd.xml -f

2) yum clean all清理下yum緩存

 

3) 更新yum updateyum

updateLoaded plugins: fastestmirror, securitySetting up Update ProcessLoading mirror speeds from cached hostfile *base: mirrors.aliyun.com *epel: mirrors.aliyun.com *extras: mirrors.aliyun.com *updates: mirrors.aliyun.com···························略

4) 從新執行

yum install ipvsadm -y

Loaded plugins: fastestmirror, securitySetting up Install ProcessLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.aliyun.com·······················略                                                           

Complete!原命令執行成功yum問題解決!

結論:

  yum中「repomd.xml」做用,是提供了「更新.xml.gz」的下載信息和SHA校驗值。若執行yum makecache將服務器上的軟件包本地緩存,後將*.xml中的檢驗值更改,致使yum下載校驗出錯,用的時候慎重(yum makecache問題目前解釋短淺,會繼續跟蹤,排錯僅供臨時解決問題)

相關文章
相關標籤/搜索