YUM error performing checksum : How we correct it?
Are you struggling with YUM error performing checksum?
Occasionally while installing a package or updating using YUM command ends up in this error.
The error is usually generated when the checksum algorithm specified in the repository file will not support the yum version.
At Bobcares, we often get requests to fix yum errors, as a part of our Server Management Services.
Today, let’s have a quick look at reasons for the occurrence of this error. We’ll also see how our Support Engineers fix the error performing checksum.
Why yum error performing checksum?
Yum stands for Yellowdog Updater, Modified. YUM is a program that manages installation, updates, and removal for Red Hat package manager (RPM) systems.
A checksum is a small-sized datum assigned to any file for the purpose of detecting errors. In other words, when the file goes corrupt, the checksum may not match. Thus it indicates an error.
Generally, yum error performing checksum occurs when we install or update a new package using yum.
The error message appears as:
Often the error happens when installing packages that do not match the server architecture.
The error has been identified when yum update on a Centos5 or RHEL5 box, using RPMs from a repository on a CentOS6 or RHEL6 server (or anywhere else with a more modern createrepo available). Createrepo is a program that creates a repomd (xml-based rpm metadata) repository from a set of RPMs.
In simple words, from the error, it’s clear that the yum is unable to calculate the sha256 checksum. This happens due to the necessary libraries not available for yum to calculate the new checksum correctly.
Let, see how our support engineers help to fix this problem by various methods.
Different methods to fix yum error performing checksum!
At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face problems with the yum error performing checksum.
Now, let’s see the major reasons for this error and how our Support Engineers fix this error by different methods.
1. Installing python-hashlib
Python 2.6 uses hashlib to perform checksums whereas Python 2.4 uses the SHA module to perform checksums. The version of the SHA module that ships with CentOS 5.3 doesn’t support sha256, that is why we get the checksum error.
Recently, one of the customers had a problem with yum error performing checksum while installing a package using the yum. Installing the python-hashlib package help to add SHA256 capabilities. Therefore our Support Engineers fixed the error by installing python-hashlib to resolve this problem.
yum install python-hashlib
After installing python-hashlib, SHA256 algorithm worked with Yum command. This fixed the error.
2. Removing offending repo
In addition, some customers returned to us with the following error while installing the python-hashlib.
yum install python-hashlib Loaded plugins: downloadonly-background, fastestmirror, ibm-check-lotus-updates, ibm-repository, refresh-packagekit, security, versionlock Loading mirror speeds from cached hostfile Setting up Install Process Package python-2.6.6-29.el6_3.3.x86_64 already installed and latest version Nothing to do [root@xxx ~]#
After further investigations, we found that there was some offending repo created. We disabled some offending repo before installing python-hashlib.
We did the following steps:
1. Initially, we opened the following configuration file and set the enable variable to 0
2. Then after editing this file, we installed the python-hashlib.
yum install python-hashlib
3. Finally, we re-enabled the new repo
And this fixed the error.
3. Create the repo using sha1
However, in certain situations, where the customer was using a custom repository made by a newer version of “createrepo” causes the same error. Here the repodata checksum had generated with sha256, which was not supported by yum in Centos 5. This leads the customer with the following error:
https://some-repository.com/repodata/6bf3eabf71186292f5559891e9161887b45a647318499e1b0e3b05d6b6e4f62b-primary.sqlite.bz2: [Errno -3] Error performing checksum
Hence, we re-generated the repo metadata with sha1 checksum by using the following command.
createrepo -d -s sha1 /path/to/repo
After creating repo metadata with sha1, made everything worked as expected
4. Disable epel
The checksum error can happen even with the error in the epel repository. In such cases, an immediate fix is to disable the epel repo.
We can disable either via editing the file as enable=0 or else rename the file. Here we disabled it by renaming the file.
yum clean all
We have fixed this error of many customers by disabling epel.
5. Reinstall package
Last, but not the least, often reinstalling the package also can solve the yum error performing checksum. Here, with the reinstall, all the files will be overwritten with the correct files.
[Still having trouble in fixing yum errors? – We’ll help you.]
In short, yum error performing checksum occur due to many reasons. The most common reasons are an unsupported repository with yum version, yum cache and so on. Today, we saw how our Support Engineers fixed this error.