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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
/var/tmp/hahaha.txt.

 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
again.

 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.

Thanks.




--- Sam Varshavchik <mrsam@xxxxxxxxxxxxxxx> 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@xxxxxxxxxx
> To unsubscribe:
https://www.redhat.com/mailman/listinfo/fedora-list


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux