Sometimes you might land up with this error – Metadata file does not match checksum while performing any yum
operation. For instance, I was using
command to check if a particular binary is available in any package and the result was “Metadata file does not match checksum“.yum
provides
Here’s the complete error message.
# yum provides hdparam Not using downloaded repomd.xml because it is older than what we have: Not using downloaded repomd.xml because it is older than what we have: http://vault.centos.org/5.11/os/x86_64/repodata/filelists.sqlite.bz2: [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.
This tutorial will explain how to fix Metadata file does not match checksum error while performing yum
operations.
How to fix Metadata file does not match checksum
This error occurs when files such as respomd.xml, filelists.xml.gz, filelists.sqlite.bz2, primary.xml.gz
are cached in your local disk under '/var/yum/cache'
and those files don’t match with the ones in the yum repository. Due to inconsistency in HTTP caching of these files, yum
command fails with checksum error.
The respomd.xml file describes rest of the file and contains hash value, which is then used to perform checksum. To solve this error, you may have to clear the yum
cache as shown below:
# yum clean all Loaded plugins: fastestmirror, security Cleaning up Everything Cleaning up list of fastest mirrors
However, the same can be achieved by setting http_caching attribute to none in yum.conf. But this solution didn’t work for me. You may want to try this suggestion.
That’s it! Now try any yum operation and the new files will be download to yum cache directory.
yum clean all not working for me