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


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

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

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…………此處略=

追尋錯誤根源:

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

yum install ipvsadm -y正常 

猜想:本機epel執行過的yummakecache導致epel源改變2、更新本機所有軟件版本:

 

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

| 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問題目前解釋短淺,會繼續跟蹤,排錯僅供臨時解決問題)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM