Metadata file does not match checksum – YUM error!

Updated on November 9, 2017

Sometimes you might land up with this error – Metadata file does not match checksum while performing any yum operation. For instance, I was using yum provides command to check if a particular binary is available in any package and the result was “Metadata file does not match checksum“.

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.

Prerequistes:

You need root privileges to fix this error.

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.

Note:

/var/yum/cache directory might differ on your machine. You may want to confirm your cache directory by looking at the attribute 'cachedir' in yum.conf file.

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
Note:

yum clean all requires root privileges. Else, you will see the below error.

$ yum clean all
Loaded plugins: fastestmirror, security
You need to be root to perform this command.

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.

Was this article helpful?

Related Articles

Comments Leave a Comment

Leave a Comment