Failed RPM database
Tue 13 January 2015
RPM database screwed RPM the package manager of Red Hat sometimes goes a bit wierd, the database becomes bad the way to clear it is as such: A simple check for the database is:
rpm -qa –qf ‘%{name}-%{version}-%{release}.%{arch}.rpm\n’
If this fails to complete or hangs then it is a good guess that the RPM database is corrupted follow the below procedure.
- First take a backup of the rpm database
cd /var/lib
tar cvf rpmbackup.tar
gzip rpmbackup.tar
- Try first to rebuild the database (you can go direct to step 3! if you don’t have much time or enjoy rpm)
rpm -vv —rebuilddb
- In the event that this hangs or fails
rm -f __db*
rpm -vv —rebuilddb
DO NOT remove any of the other files in the rpm directory otherwise you have a really big problem as you will have to re create the rpm database and the installed packages will be lost this is not a good situation to be in!!!