Nightkap
07-02-2007, 02:13 PM
I am trying to compare RHEL and CentOS's default installed packages. I understand they're supposed to be identical but there are differences in package versions and excluded packages that can't be ported over to Cent (namely RHN-tools and the like)
here my situation:
On both linux systems I grabbed a list of all installed packages and dumped them into a file.
Red Hat Enterprise Linux 4 (default install)
$ rpm -qa > rhel.installed.pkgs
Centos 4.4 (default install)
$ rpm -qa > centos.installed.pkgs
I then used the “diff” command to compare the 2 files against each other and pipe the results through the word count program with the -l switch to display the number of lines in the file, the results where not what I had expected.
$ diff rhel.installed.pkgs centos.insalled.pkgs | wc -l
881
Clearly there are not 881 different packages installed. The diff command compares line by line so if the order is off this will not report what I'm looking for. So I did a sort on both files and tried again (728 lines) but of course as soon as it sees any inconsistencies it will again report data I'm looking for incorrectly.
it there an easy way of comparing 2 files against each other and writing the unmatched results to a file???
Thanks for any help,
here my situation:
On both linux systems I grabbed a list of all installed packages and dumped them into a file.
Red Hat Enterprise Linux 4 (default install)
$ rpm -qa > rhel.installed.pkgs
Centos 4.4 (default install)
$ rpm -qa > centos.installed.pkgs
I then used the “diff” command to compare the 2 files against each other and pipe the results through the word count program with the -l switch to display the number of lines in the file, the results where not what I had expected.
$ diff rhel.installed.pkgs centos.insalled.pkgs | wc -l
881
Clearly there are not 881 different packages installed. The diff command compares line by line so if the order is off this will not report what I'm looking for. So I did a sort on both files and tried again (728 lines) but of course as soon as it sees any inconsistencies it will again report data I'm looking for incorrectly.
it there an easy way of comparing 2 files against each other and writing the unmatched results to a file???
Thanks for any help,