I wanted to make sure that the same RPMs were installed on several servers. I wasn’t worried about versions of RPMs because everything should be kept up to date via yum. So I sat down and wrote the script below. It has been on my ToDo list for quite a while!
RRPM=$(ssh $REMOTESERVER "rpm -qa --queryformat '%{NAME}\n'" ) LRPM=$(rpm -qa --queryformat '%{NAME}\n') echo "*** Missing from $REMOTESERVER" *** grep -vf <(echo "$RRPM"| sort) <(echo "$LRPM"|sort) echo echo "*** Missing from Local system ***" grep -vf <(echo "$LRPM"| sort) <(echo "$RRPM"|sort) echo
This script connects to a remote machine and compares RPMs installed there to the RPMs that are installed locally.
Thanks for the code, here is my modified version that does exact maching on the names, so for instance it can tell you that you are missing php, php-cli, php-common even if the server has php installed
Thanks for taking the time to update/comment! I haven’t looked at this code in a while, but I believe I might need it soon, and I will incorporate your changes
Thanks.