The Problem
Scenario 1:
The user is unable to perform “yum install oracle-rdbms-server-11gR2-preinstall”.
The yum tries to download the latest metadata (“http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/primary.xml.gz” ) and rejects it with the error message “[Errno -1] Metadata file does not match checksum”. Upon this, yum tries the next mirror where it encounters the same error and goes to the next mirror and so on until it have tried all mirrors and ends with error “No more mirrors to try.”
# 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.
Scenario 2:
Run uln_mirror script also failed with error of ‘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, inmain() 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
The Solution
The yum server contains metadata and checksum for the metadata. After downloading metadata and checksum, yum client compares the two to make sure they’re consistent. There should be issues with caching of metadata, which leads to the error where yum tries to download the latest metadata.
Option 1
Firstly try purge all yum caches:
# yum clean all # rm -rf /var/cache/yum/* # yum repolist
Option 2
Clean metadata:
# yum clean metadata
Option 3
Edit file /etc/yum.conf and add a line “http_caching=packages” as below:
# 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 # manually 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
1. Just wait for the http cache to time out.
2. For each file issue a ‘wget’ with the no-cache option:
# wget --no-cache http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/repodata/primary.xml.gz
3. Temporarily configure yum to not use cached versions of files. Edit /etc/yum.conf, and add the following line:
http_caching=none