yum leaving multiple versions installed

Thomas J. Baker tjb at unh.edu
Sat Feb 4 17:10:31 UTC 2006


On Sat, 2006-02-04 at 17:31 +0200, Ville Herva wrote:
> On Wed, Feb 01, 2006 at 09:47:32PM -0500, you [Thomas J. Baker] wrote:
> > 
> > This should be x86_64 compatible although I don't have any broken x86_64
> > systems to test it on!
> > 
> >     rpm -e --justdb --nodeps $RPM                                               
> 
> Why --justdb?
> 
> Suppose I have these installed:
> 
>  nut-client-2.0.0-1.cr2  
>  nut-client-2.0.2-6
> 
> doesn't "rpm -e --justdb nut-client-2.0.0-1.cr2" leave the files from old
> package that the new one did not replace hanging around (and very hard to
> track down and weed)?
> 
> I've been using this to list the duplicates:
> 
>  rpm -aq --queryformat "%{NAME}\n" | sort | uniq -c | grep -v -E " *1 "
> 
> and something like this:
> 
>  for i in $(rpm -aq --queryformat "%{NAME}\n" | sort |
>             uniq -c | grep -v -E " *1 " | gawk '{print $2}'); do
>    rpm -e --nodeps $(rpm -q $i |head --lines=-1)
>  done
> 
> to remove them. I'm not sure if that's any better than yours.
> 
> I guess "rpm -V $package" is a good idea after "rpm -e <old>" and I've even
> done "rpm -i --force <new>" to be sure (after removing duplicate glibc's
> etc). -V hasn't usually reported problems, though.
> 
> And yes, this is often needed. Just yesterday, yum update from rawhide
> decided to update around 200 package. It churned the harddisk led for ages
> and then went on updating. It didn't take particularry much memory or
> anything, and everything seemed normal. But after installing ~30 packages,
> it just quit quietly. No errors or anything. Yum didn't run the cleanup
> stage at all, so I had 30 duplicate packages installed. 
> 
> Trying to rerun yum update caused its memory usage to skyrocket and it
> brought the whole system to its knees. Mouse moved every minute or so, and
> eventually kernel OOM rambo killed yum (after slaughtering 10 or so innocent
> processes, bleah) which restored the box back to life. I had to manually rpm
> -F the packages from /var/cache/yum/development/packages and then weed out
> the 30 duplicates.
> 
> The "yum quits silenly in install stage" problem has happened at least three
> times for me, usually when the rawhide update has been large due to few
> days' delay in updating.
> 
> Couldn't yum clean up more often (even after installing each package)? It
> would be nice if yum could somehow slice the large updates to something it
> can swallow without breaking, but I guess that's more complicated.
> 
> 
> -- v -- 
> 
> v at iki.fi
> 

I use justdb because in all my cases, it seems the new rpm is really
installed but the old one is not erased from the database. After
erasing, my script then verifies the newer rpm to make sure it is really
installed so it is a good idea to keep an eye on the results.

tjb
-- 
=======================================================================
| Thomas Baker                                  email: tjb at unh.edu    |
| Systems Programmer                                                  |
| Research Computing Center                     voice: (603) 862-4490 |
| University of New Hampshire                     fax: (603) 862-1761 |
| 332 Morse Hall                                                      |
| Durham, NH 03824 USA              http://wintermute.sr.unh.edu/~tjb |
=======================================================================




More information about the test mailing list