Recovering from a half finish YUM operation
by Tinuva on Oct.06, 2009, under Linux
The other day I was doing updates on a CentOS 5.x 64bit server when yum failed halfway through leaving me with multiple versions of the same package installed ect. The problem was the RPM database became corrupted which needed a repair. This I did with the help of a co-worker who figured out the following commands can help:
mkdir rpmdb
cp /var/lib/rpm/__db* rpmdb/
rm /var/lib/rpm/__db*
rm: remove regular empty file `/var/lib/rpm/__db.000′? y
rm: remove regular file `/var/lib/rpm/__db.001′? y
rm: remove regular file `/var/lib/rpm/__db.002′? y
rm: remove regular file `/var/lib/rpm/__db.003′? y
rpm –rebuilddb
After that, to clean up the packages I installed the package “yum-utils” and executed the command
yum-complete-transaction
Other useful commands when you have problems:
yum clean metadata
yum clean all