Your RPM database will likely be corrupted if you see this error using yum or rpm. Here’s a fast fix:
- Back up your current RPM DB:
mkdir /var/lib/rpm/backup
cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
- Remove the broken DB files:
rm -f /var/lib/rpm/__db.[0-9][0-9]*
- (Optional) Clean yum cache:
If you’re still stuck, check disk space or ask for help below!