www. On IT Road .com
选项 1
首先尝试清除所有 yum 缓存:
# yum clean all # rm -rf /var/cache/yum/* # yum repolist
解决方案
yum 服务器包含元数据和元数据校验和。
下载元数据和校验和后,yum 客户端会比较两者以确保它们一致。
元数据缓存应该有问题,这会导致 yum 尝试下载最新元数据的错误。
选项 2
清理元数据:
# yum clean metadata
选项 3
编辑文件 /etc/yum.conf 并添加一行“http_caching=packages”,如下所示:
# vi /etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3 http_caching=packages # This is the default, if you make this bigger yum won't see if the metadata # is newer on the remote and so you'll "gain" the bandwidth of not having to # download the new metadata and "pay" for it by yum not having correct # information. # It is esp. important, to have correct metadata, for distributions like # Fedora which don't keep old packages around. If you don't like this checking # interupting your command line usage, it's much better to have something # bananaally check the metadata once an hour (yum-updatesd will do this). # metadata_expire=90m # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d
等待http缓存超时。
为每个文件发出一个带有 no-cache 选项的 'wget':
# wget --no-cache http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/primary.xml.gz
- 临时配置 yum 不使用缓存版本的文件。
编辑 /etc/yum.conf,并添加以下行:
http_caching=none
问题
场景一:
用户无法执行“yum install oracle-rdbms-server-11gR2-preinstall”。
yum 尝试下载最新的元数据(“http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/primary.xml.gz”)并拒绝它并显示错误消息“[ Errno -1] 元数据文件与校验和不匹配”。
在此之后,yum 会尝试遇到相同错误的下一个镜像并转到下一个镜像,依此类推,直到它尝试了所有镜像并以错误“没有更多的镜像要尝试”结束。
# yum install oracle-rdbms-server-11gR2-preinstall Loaded plugins: refresh-packagekit, security ol6_UEK_base | 951 B 00:00 ol6_UEK_base/primary | 686 kB 00:09 ol6_UEK_base 29/29 ol6_UEK_latest | 1.2 kB 00:00 ol6_ga_base | 1.1 kB 00:00 ol6_ga_base/primary | 2.9 MB 00:34 ol6_ga_base 8029/8029 ol6_latest | 1.4 kB 00:00 ol6_latest/primary | 22 MB 04:48 http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum Trying other mirror. ol6_latest/primary | 22 MB 04:42 http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/primary.xml.gz: [Errno -1] Metadata file does not match checksum Trying other mirror. Error: failure: repodata/primary.xml.gz from ol6_latest: [Errno 256] No more mirrors to try.
场景2:
运行 uln_mirror 脚本也失败,错误是“Metadata File Does Not Match Checksum 元数据文件与校验和不匹配”
#/usr/bin/uln-yum-mirror --snip- rhnplugin.py:410:_getFile:RepoError: failed to retrieve repodata/update=einfo.xml.gz from ol6_x86_64_latest error was [Errno -1] Metadata file does not match checksum : Traceback (most recent call last): File "/usr/bin/reposync", line 352, in main() File "/usr/bin/reposync", line 256, in main resultfile =3D repo.retrieveMD(ftype) File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 1571, i=n retrieveMD : return self._retrieveMD(mdtype) File "/usr/lib/python2.6/site-packages/yum/yumRepo.py", line 1654, i=n _retrieveMD : size=3Dthisdata.size) File "/usr/share/yum-plugins/rhnplugin.py", line 410, in _getFile : self.id, e) RepoError: failed to retrieve repodata/updateinfo.xml.gz from ol6_x86_= 64_latest :error was [Errno -1] Metadata file does not match checksum
日期:2020-09-17 00:14:16 来源:oir作者:oir