Tuesday, December 11, 2007

When Yum Corrupts Its Own rpm Database

I was using yum the other to update a CentOS 5 server after a long time. It got stuck on a long download and didn't seem to quit even after a long time. Tried ending the process using

> kill pid
> kill -INT pid

This did nothing and the process was still hung. Finally used the trusty but dangerous kill -9 which terminated the process. But this made matters worse. Now yum wouldn't even start. A quick google search led to someone speculating that such forceful killing of the process could have corrupted the rpm database. Per their suggestion,

> rm /var/lib/rpm/__db*
> rpm --rebuilddb
> yum clean all

This fixed everything. Not sure what the above does exactly, but hopefully it's ok. This was not a production box, so it was fine. Yum works!

No comments: