--- Compare two files to see what is in both and uniq in each ---
01 Collect the package names on each server
rpm -qa > servername.file
rpm -qa > servername2.file
02 Move them to a common location
03 Sort each RPM file
sort servername.file -o servername.file
04 Create a file with common packages
sort servername.file servername2.file | uniq -d > both
05 Do a uniq -u on each server file against the both file which displays what is on one NOT the other
sort servername.file both | uniq -u
This may|should work to remove the version if compare to different releases
cat servername.file | sed "s/-[0-9]/ /" |awk '{print $1}'
cat servername.file | sed "s/-[0-9]/ /" |awk '{print $1}' > servername.file.noversion