Problem:
Ran into this error while attempting to apply a yum update on a CentOS 6 machine to update its kernel packages.Error: Rpmdb changed underneath usThe same scenario applies if you get this error as well:
error: can not open Packages database in /var/lib/rpm
Cause:
The problem has to do with corruption in the RPM database files under the /var/lib/rpm directory.Solution:
- Check for any processes that might be currently running and having a lock on the rpm database and kill them if they exist:
- ps -aufx | grep /var/lib/rpm
- Delete the temporary DB files:
- rm -fv /var/lib/rpm/__*\
- Rebuild your server RPM database using the below command:
- rpm --rebuilddb -v -v
Original Solution Post: