无法更新 CentOS 5 - Yum 错误

无法更新 CentOS 5 - Yum 错误

我已经习惯了 CentOS 5 上的 Yum 每隔一周就会崩溃一次,但到目前为止,我总是能够通过简单地运行以下命令来解决问题:

yum clean all

然后就可以正常更新了。

今天无法使用。我谷歌搜索了很多,另一个常见的建议是禁用 fastmirror,我也试过了,但仍然无济于事。这是我收到的错误:

# yum update
addons                                                                               |  951 B     00:00     
addons/primary                                                                       |  204 B     00:00     
base                                                                                 | 2.1 kB     00:00     
base/primary_db                                                                      | 2.2 MB     00:00     
extras                                                                               | 2.1 kB     00:00     
extras/primary_db                                                                    | 244 kB     00:00     
spacewalk-client-tools                                                               | 1.9 kB     00:00     
spacewalk-client-tools/primary_db                                                    |  15 kB     00:00     
updates                                                                              | 1.9 kB     00:00     
updates/primary_db                                                                   | 603 kB     00:00     
http://ftp.heanet.ie/pub/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.as29550.net/mirror.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.melbourne.co.uk/sites/ftp.centos.org/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.ellogroup.com/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.netrino.co.uk/mirror.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.coreix.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.krystal.co.uk/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.ukfast.co.uk/sites/ftp.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://anorien.csc.warwick.ac.uk/mirrors/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.ox.ac.uk/sites/mirror.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.bytemark.co.uk/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://ftp.nluug.nl/ftp/pub/os/Linux/distr/CentOS/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.denit.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.oxilion.nl/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://ftp.tudelft.nl/centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.widexs.nl/ftp/pub/os/Linux/distr/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.nl.leaseweb.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.supportex.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://centos.mirror.evertje.net/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://nl.mirror.eurid.eu/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://ftp.heanet.ie/pub/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.as29550.net/mirror.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.melbourne.co.uk/sites/ftp.centos.org/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.ellogroup.com/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.netrino.co.uk/mirror.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.coreix.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.krystal.co.uk/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.ukfast.co.uk/sites/ftp.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://anorien.csc.warwick.ac.uk/mirrors/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.ox.ac.uk/sites/mirror.centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.bytemark.co.uk/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://ftp.nluug.nl/ftp/pub/os/Linux/distr/CentOS/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.denit.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.oxilion.nl/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://ftp.tudelft.nl/centos.org/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.widexs.nl/ftp/pub/os/Linux/distr/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirror.nl.leaseweb.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://mirrors.supportex.net/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://centos.mirror.evertje.net/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
updates/primary_db                                                                   | 603 kB     00:00     
http://nl.mirror.eurid.eu/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2: [Errno -1] Metadata file does not match checksum
Trying other mirror.
Error: failure: repodata/primary.sqlite.bz2 from updates: [Errno 256] No more mirrors to try.
#

是否可能每个正在尝试的 yum 镜像都有一个失效的 sqlite 包?有没有办法告诉 yum 忽略 sqlite 并只更新其余的?我尝试了 --skip-broken,但它仍然出错并出现相同的错误。

CentOS 最近太烂了 :(

巴特。

答案1

我检查了一下http://nl.mirror.eurid.eu/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2,镜子看起来没问题。

为了检查,我手动拉下了该文件:

wget http://nl.mirror.eurid.eu/centos/5.6/updates/x86_64/repodata/primary.sqlite.bz2

在其上运行 sha1sum:

$ sha1sum primary.sqlite.bz2 
0c3f80f4063c9e64c000c5e6f1e5bda0a0623822  primary.sqlite.bz2

$ bzip2 -d primary.sqlite.bz2
$ sha1sum primary.sqlite 
adda574a8d795705b80d6c2003947c1ae2797f5f  primary.sqlite

并根据列出的值检查这些值http://nl.mirror.eurid.eu/centos/5.6/updates/x86_64/repodata/repomd.xml

<data type="primary_db"><location href="repodata/primary.sqlite.bz2"/>
  <checksum type="sha">0c3f80f4063c9e64c000c5e6f1e5bda0a0623822</checksum>
  <timestamp>1307575563</timestamp>
  <open-checksum type="sha">adda574a8d795705b80d6c2003947c1ae2797f5f</open-checksum>
  <database_version>10</database_version>
</data>

尝试并以相同的方式yum clean all检查文件。/var/cache/yum/...

答案2

然后尝试一下 yum.conf 中的 http_caching=none

参考:http://plone.lucidsolutions.co.nz/linux/rpm/yum-metadata-file-does-not-match-checksum

答案3

看来简单的答案就是等待一天然后再试一次。

由于我这边从昨天到现在没有任何变化,所以 CentOS 人员一定已经修复了他们那边的某种错误。

相关内容