How to fix yum error: database disk image is malformed
If you encounter “Error: database disk image is malformed” when using yum to install or update a package, as shown below:
[root@Ezylinux.com ~]# yum install ruby
Loaded plugins: fastestmirror, langpacks, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirror1.ku.ac.th
* epel: mirror1.ku.ac.th
* extras: mirror1.ku.ac.th
* updates: mirror1.ku.ac.th
Error: database disk image is malformed
Fix it by running:
[root@Ezylinux.com ~]# yum clean dbcache
or
[root@Ezylinux.com ~]# yum clean all