Re: yum leaving multiple versions installed

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

 



On Sunday 05 February 2006 12:54, Jim Cornette wrote:
> This addition would probably help prevent duplicates showing up on i386
> and 64-bit architectures. I get the below output but only have an i686.
> I guess those with 64 bit would need to try out the command to see what
> shows up.

Ok, I think I have something that works for everyone.
-Steve


#!/bin/sh

# Add any package here that is OK to have duplicates
dups="gpg-pubkey|kernel|kernel-devel"

# Test 1. Look for multiple versions of the same package
# We use # as a separator so that we can remove it later. # is not in any
# package name that I know of and that's the basis of using it.
list=`rpm -qa --queryformat "%{NAME}#%{ARCH}\n" | sort | uniq -c |  tr '#' ' ' 
| egrep -vw "$dups" | awk '$1 > 1 { print $2 } '`

if [ x"$list" != "x" ] ; then
        echo "Duplicates were found:"
        echo $list | xargs rpm -q
        exit 1
fi

# Test 2. Check for mismatched versions
list=`rpm -qa --queryformat "%{NAME}\n" | sort | uniq -c | egrep -vw $dups | 
awk '$1 == 2 { print $2 } '| xargs rpm -q --queryformat 
"%{NAME}-%{VERSION}-%{RELEASE}\n" | sort | uniq -c | awk '$1 == 1 { print 
$2 }' | xargs rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n"`

if [ x"$list" != "x" ] ; then
        echo "Version mismatches were found:"
        echo $list | tr ' ' '\n'
        exit 1
fi

exit 0

-- 
fedora-test-list mailing list
fedora-test-list@xxxxxxxxxx
To unsubscribe: 
https://www.redhat.com/mailman/listinfo/fedora-test-list

[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]