Obtaining a proper list of installed packages on Red Hat

On Red Hat Enterprise Linux there is the rpm command to install and query packages. Of course this command is also available on Red Hat derivatives as CentOS, Fedora and more. However standard use of the rpm command will show just basic information i.e.:

# rpm -qa sysstat

This information is useful but doesn’t help when you want to compare the installed packages on two systems. I use the following query to get the full list of installed packages with proper file name including architecture and release version (as they appear on the installation media):

# rpm -qa --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm\n' | sort | uniq > RH_packages.txt

You can also use this information to make a stripped down version of the installation media image which I will demonstrate in a later post.

This entry was posted in Linux, Red Hat. Bookmark the permalink.

Leave a Reply

Your email address will not be published.