今日使用yum更新CentOS5,有如下报错:Metadata file does not match checksum
# yum update
---> Omit...
---> Package python-libs.i386 0:2.4.3-43.el5 set to be updated
base/filelists | 2.9 MB 00:00
updates/filelists_db | 1.3 MB 00:00
[Errno -1] Metadata file does not match checksum
Trying other mirror.
Error: failure: repodata/filelists.sqlite.bz2 from updates: [Errno 256] No more mirrors to try.
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
# cd /var/cache/yum/updates
# ls
filelists.sqlite.bz2 filelists.xml.gz other.sqlite.bz2 other.xml.gz primary.sqlite.bz2 primary.xml.gz repomd.xml
# sha1sum filelists.sqlite.bz2
08cad60d20789df0bf3b796d9c67406198374804 filelists.sqlite.bz2
# cat repomd.xml
7b677881d04555b8fd96e9f59f03cbc637e8daa9
1303318568
118f091840992723db0a59db23a2698a800a7026
10
a99c6466a336cb26d710264035f3be1c094bfad9
1303318558
3e1b68f02d7ef1a8b21960636d33508d610d65ef
413e438d5589cba1b3597845de6c90aef2c1ea12
1303318575
25cab50c62d094dd90c57a71b388b49e19202348
10
0edf55e3126bbd6f150307aa1064474c205beda6
1303318558
007f58eb79a53c12d16529c12b2e635f7557c625
fdf98571a4f6b1319db58a3895402fe590020fde
1303318577
dfc3b2426a27376a80c62ee914e4dd9cf785f727
10
ce27f621364c94bd31ba03b7f586ad22417ab2c3
1303318558
04c9d0541846b004ebfc247034792f101ed2acb0
校验值不一样,清空cache,手动下载文件
# yum clean all
# wget --cache=off
# wget --cache=off
# sha1sum filelists.sqlite.bz2
08cad60d20789df0bf3b796d9c67406198374804 filelists.sqlite.bz2
# cat repomd.xml
7b677881d04555b8fd96e9f59f03cbc637e8daa9
1303318568
118f091840992723db0a59db23a2698a800a7026
10
a99c6466a336cb26d710264035f3be1c094bfad9
1303318558
3e1b68f02d7ef1a8b21960636d33508d610d65ef
413e438d5589cba1b3597845de6c90aef2c1ea12
1303318575
25cab50c62d094dd90c57a71b388b49e19202348
10
0edf55e3126bbd6f150307aa1064474c205beda6
1303318558
007f58eb79a53c12d16529c12b2e635f7557c625
fdf98571a4f6b1319db58a3895402fe590020fde
1303318577
dfc3b2426a27376a80c62ee914e4dd9cf785f727
10
ce27f621364c94bd31ba03b7f586ad22417ab2c3
1303318558
04c9d0541846b004ebfc247034792f101ed2acb0
校验值还是不一样,只能手工修改了,把repomd.xml文件里的
7b677881d04555b8fd96e9f59f03cbc637e8daa9
其中的sha值替换为08cad60d20789df0bf3b796d9c67406198374804,保存后再运行
# yum update
这次无报错,顺利更新。
我不知道是yum源同步造成的sha校验值不一致,还是centos源本身就有问题,总之这几天非常不稳定。昨天升级时也发现校验值不一致情况,而且google了一下,发现其他用户也有同样的问题。
另外,mirrors.sohu.com这个镜像有问题,updates下面好多文件都没有,建议使用mirrors.163.com
阅读(5095) | 评论(0) | 转发(0) |