Linux : Yum Error: database disk image is malformed

By | November 23, 2014

Having this error message while running a “yum install” or “yum update” command on your RHEL/CentOS Linux system?

Error: database disk image is malformed

1. Simply run the following command to fix this issue :

yum clean all

2. Alternatively, if the problem is still persisting, then try to move the RPM database to a temporary location :

mv /var/lib/rpm/__db* /tmp

And rebuild the RPM database :

rpm --rebuilddb

(you may now remove “__db*” from /tmp if everything went as expected)