# ssh root@remotehost 'rpm -qa | sort' | diff -u <(rpm -qa | sort) -
If the above command gives no output, it means that the two hosts have identical packages installed. If you want to disregard the package version differences in the comparison, then you will need to use something like this:
# ssh root@remotehost 'rpm -qa --queryformat "%{NAME}\n" | sort' | diff -u <(rpm -qa --queryformat "%{NAME}\n" | sort) -Update(2013-07-02):
Following Paul Waterman's comment, I did try out his rpmscomp Perl script, and I did find it useful. So I would recommend you also give it a try: https://github.com/pdwaterman/rpmscomp Also, to help in removing packages, I have found the rpmreader package useful: https://fedorahosted.org/rpmreaper/
1 comment:
Another alternative is a tool that I recently uploaded to GitHub: https://github.com/pdwaterman/rpmscomp
The rpmscomp tool allows you to quickly and easily compare the RPMs installed on any number of systems -- it'll go out and grab the list of what's installed and list out what's installed on all systems side-by-side (or just the diffs if that's what you'd prefer).
Example:
rpmscomp --diffonly @host1 @host2 @host3 @host4 @host5
It also has various other capabilities, such as the ability to grab and store lists of installed packages for later comparison.
Post a Comment