rpm db rebuild question

Jarod Wilson jarod at wilsonet.com
Mon Nov 12 16:46:12 EST 2007


On Monday 12 November 2007 01:58:43 pm t.littlefield at comcast.net wrote:
[...]
> This caused all sorts of havoc, from corrupted mythconverg tables to the
> previously mentioned RPM problems.  I was able to recover the db problems
> after some digging.  The only thing I have found for RPM is to run
>
> rpm --reubuilddb
>
> Which does run...  the end result is 121 packages in the db.  One of the
> files --rebuilddb pulls from appears to have gotten pooched. (Packages
> perhaps, don't remember which one).  In any event, I can no longer do a yum
> update on the system.
>
> The only solution I can think of is to:
>
> - stop mythtv
> - perform a mysql dump
> - backup the config files
> - reinstall FC6 and mythtv
> - yum update
> - restore the mysql db
>
> I've got too many shows backlogged on disk to start clean (although they
> are on a separate file system).  If anyone on the list can supply a little
> rpm black magic to recover the packages that are installed, I would be most
> appreciative.  :-)

So far as I know, if nuking /var/lib/rpm/__db.* and running 'rpm --rebuilddb' 
doesn't do the trick, you're probably SOL. I've only ever managed to corrupt 
an rpm database that badly once in my life (circa Red Hat Linux 9, iirc), and 
lucky me, I had a very similar system nearby that I just copied the rpmdb 
from, which was 'close enough' until that system was decommissioned.

Another idea... If you have a good idea of what packages were actually 
installed, you can try "reinstalling" all of said packages. /root/install.log 
gives at least a list of what was initially installed, and you may be able to 
glean most other bits of info from /var/log/messages* if you 
installed/updated other packages using yum (at least, I think yum logged that 
stuff in FC6). So basically, parse logs, then for package in packages, yum -y 
install package.

-- 
Jarod Wilson
jarod at wilsonet.com


More information about the gnhlug-discuss mailing list