如今开源的yum 有ustc和163。从网上直接下载的repo文件,运行会报错,手工的修改了一下:web
使用的是ustc的yum,配置文件以下:算法
[root@web1 yum.repos.d]# cat ustc.repo sql
[base]centos
name=CentOS-5.9 - Base -mirrors.ustc.edu.cnide
baseurl=http://mirrors.ustc.edu.cn/centos/5.9/os/$basearch/google
gpgcheck=0url
enabled=1spa
#released updates .net
[updates]3d
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