[Yum] yum and crash recovery

seth vidal skvidal at linux.duke.edu
Fri Mar 2 18:20:34 UTC 2007


On Fri, 2007-03-02 at 12:35 -0500, Michel Salim wrote:
> 2007/3/2, Fajar A. Nugraha <fajar at fajar.net>:
> > Michel Salim wrote:
> > > I have an unreliable system that is prone to overheating (at which
> > > point the kill switch would mercifully save the CPU from a flaming
> > > death, but at the expense of whatever is going on at the moment) --
> > > and doing a large yum transaction is quite reliable at causing a
> > > lock-up (I'm making sure I set the CPU speed to minimum before
> > > updating now).
> > >
> > I may be saying the obvious here, but you should find out how to cool
> > down that server, or throw it away. Unless it's NOT a server :-P
> 
> That's the scary thing. It's a laptop (Turion 64)! And it's a good
> suggestion -- I'm waiting for the next iteration of the Macbook.
> Hopefully Linux has full support for it by then (apart from EFI)
> 
> > > Anyway, the question is, if you're partway into the transaction, and
> > > some packages have been installed (but the old ones not removed yet),
> > > is there a way to tell yum to clean up the mess? There must be some
> > > transaction logs somewhere that can be used to automate the process.
> > >
> > IMHO the best way is to recover rpmdb from backup, and restart the yum
> > process.
> > SUSE has /etc/cron.daily/suse.de-backup-rpmdb. I don't think Redhat has
> > it by default.
> >
> Hmm .. the thing is, some RPMs have already been installed (e.g. if
> foo-x.y is updated to foo-y.z, the system has both installed). If I
> roll back the rpmdb, it will actually be inconsistent with what's on
> the disk, right?
> 
> What I want is a way for yum to say "oh, I detect an incomplete
> transaction -- let me just continue it and make sure the old RPMs get
> properly removed"
> 

so there's no way for yum to know based on what information is in the
rpmdb what has happened on the system. The mechanism we've been using
thus far is to:

1. look for dupes in the rpmdb
2. remove the older version
you can try running:
http://linux.duke.edu/~skvidal/useful-scripts/dupes-cli.py
to accomplish those two.

3. run rpm -Va and see what's broken
4. re-run the update command to see if it can fix the broken.



it's worth a shot. not ideal.

-sv






More information about the Yum mailing list