any existing script to fix the problem ?? -- Re: Help: aborted 'yum upgrade' and corrupted rpm database resulted

Robinson Tiemuqinke hahaha_30k at
Sat Apr 29 00:57:44 UTC 2006

Hi, Sam and Jeff,

 Thanks for your helpful guys's suggestions.

 Now since I'm being pushed to repair the crashed rpm
database, I just run the following steps to have
successfully fixed it in a quick and dirty way.

 1, cut the list of affected packages from
/var/log/yum.log file, and paste into a file

 2, rpm query the list in hahaha.txt and generate the
list of obsoleted version and save them into another
file with the following command: ( `head -1` because
ld obsolete version comes first)

for i in `cat /var/tmp/hahaha.txt `; do rpm -q ${i}|
head -1; done >/var/tmp/obsoletes

 3, feed the obsolete versions into "rpm -e --justdb":

 rpm -e --justdb `cat /var/tmp/obsoletes`

 After these three steps, rpm databases are clean

 But, the above steps has some limitations especially
when there are multilib stuff kicked in. 

 Any one in this forum has an existing script to deal
with this problem? If so, I don't need to reinvent
wheel again.


--- Sam Varshavchik <mrsam at> wrote:

> Robinson Tiemuqinke writes:
> > But when I tried to see what's in my rpm database,
> I
> > found that there are duplicate entries for all
> > packages upgraded before hang -- Yum doesn't
> cleanup
> > the old version info from rpm database because it
> > hanged and then be killed.
> > 
> > Any one know how to deal with this problem
> > effectively? I hate to list tens of obsoleted rpms
> one
> > by one and feed them to "rpm -e --justdb" command.
> Well, that's just what you'll have to do.
> When I upgraded from FC3 to FC4, for some reason
> every invocation of 
> /sbin/ldconfig from a %post and %postun segfaulted,
> when anaconda was doing 
> its business.  The end result was a crapload of
> packages that had both the 
> old and the new package versions in rpmdb.  This was
> 100% reproducible, with 
> each machine that I upgraded from FC3 to FC4.  This
> was even more fun with 
> the x86_64 FC, with multilib packages.
> rpm can really blow goats, sometimes.
> So, I just had to write a script to find every
> package with dupe versions 
> installed, and remove the obsoleted version of the
> package.

> That's life.
> > -- 
> fedora-list mailing list
> fedora-list at
> To unsubscribe:

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the users mailing list