Linux 使用開源 yum 報錯 Error performing checksum 解決方案

來源:互聯網
上載者:User

 

現在開源的yum 有ustc和163。從網上直接下載的repo檔案,運行會報錯,手工的修改了一下:

 

使用的是ustc的yum,設定檔如下:

[root@web1 yum.repos.d]# cat ustc.repo

 

[base]

name=CentOS-5.9 - Base -mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/5.9/os/$basearch/

gpgcheck=0

enabled=1

 

#released updates

[updates]

name=CentOS-5.9 - Updates -mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/5.9/updates/$basearch/

gpgcheck=0

enabled=1

 

#additional packages thatmay be useful

[extras]

name=CentOS-5.9 - Extras -mirrors.ustc.edu.cn

baseurl=http://mirrors.ustc.edu.cn/centos/5.9/extras/$basearch/

gpgcheck=0

enabled=1

 

配置好以後,執行yum update,報錯:Error performing checksum

 

[root@web1 yum.repos.d]# yum update

Loaded plugins: katello, product-id,security, subscription-manager

Updating certificate-based repositories.

Unable to read consumer identity

base                                                                                                        | 3.7 kB     00:00    

base/primary_db                                                                                              |4.4 MB     00:02    

http://mirrors.ustc.edu.cn/centos/6.4/os/x86_64/repodata/1e584feac3f3fb76ad4b6fb7e1bc8d44fa124814e9d186dc913ded3c63a216b3-primary.sqlite.bz2:[Errno -3] Error performingchecksum

Trying other mirror.

base/primary_db                                                                                             | 4.4 MB     00:02    

http://mirrors.ustc.edu.cn/centos/6.4/os/x86_64/repodata/1e584feac3f3fb76ad4b6fb7e1bc8d44fa124814e9d186dc913ded3c63a216b3-primary.sqlite.bz2:[Errno -3] Error performing checksum

Trying other mirror.

Error: failure:repodata/1e584feac3f3fb76ad4b6fb7e1bc8d44fa124814e9d186dc913ded3c63a216b3-primary.sqlite.bz2from base: [Errno 256] No more mirrors to try.

 

 

google了一下,說是在rhel 6 中 repomd.xml 檔案使用 sha256 作為hash 演算法 ,在rhel 5中 預設使用的是sha 作為hash 演算法。

 

但我是在redhat 5.8 上使用5.9的yum。 也出現了這種錯誤。

 

網上的解決方案是:使用新的sha1 來重建repo:

# createrepo -s sha1 dave-el5-x86_64

 

 

我這裡沒有建立,直接執行如下命令:

# yum clean all

 

 

然後就ok了。  小知識,隨筆記之。

 

 

 

 

 

 

 

 

 

--------------------------------------------------------------------------------------------

著作權,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!

QQ:      251097186

Skype:    tianlesoftware

Email:    tianlesoftware@gmail.com

Blog:     http://blog.csdn.net/tianlesoftware

Weibo:    http://weibo.com/tianlesoftware

Twitter:  http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.