yum leaving multiple versions installed

Ville Herva vherva at viasys.com
Mon Feb 6 22:14:56 UTC 2006


On Mon, Feb 06, 2006 at 06:18:44AM -0500, you [Steve Grubb] wrote:
> On Sunday 05 February 2006 14:26, Ville Herva wrote:
> > I small note: I think egrep -v "gpg-pubkey|kernel" will also match
> > something like "fookernel" if such package name will ever appear.
> 
> In the last version, I used "egrep -vw" which is supposed to do a word match 
> and not a partial match.

Ah, I see. 

Anyhow, this works for me:

ignore="kernel|kernel-smp|kernel-devel|gpg-pubkey"
rpm -qa --queryformat "%{NAME} %{ARCH}\n" |
   sort | uniq -c | 
   egrep -v '^      1 ' | 
   egrep -v "^ +[0123456789]+ +($ignore) " | 
   gawk '{print $2}' | 
   xargs -r rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n"




More information about the test mailing list