#!/bin/sh # Add any package here that is OK to have duplicates dups="gpg-pubkey|kernel" echo "Starting search for multiple rpms versions." echo # 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 else echo "No Duplicates found" fi echo echo "Ending Search for Multiple RPMS." exit 0 fi exit 0