Tuesday, 12 April 2011

How to find out list of forcefully installed RPM's

Recently we were asked to audit RedHat servers for RPM's which were forcefully installed
(with "--nodeps" OR "--force" option) in past.

Below if how we managed to get that working:

1) Make sure you have "yum-utils" package installed on the server.
    If n't, you can install it using yum.
                 
                # yum install yum-utils

2) Once done, you can then use "package-cleanup" command to find out dependency problems
in the local RPM database.
           
                  # package-cleanup --problems
                   Setting up yum
                   Reading local RPM database
                   Processing all local requires
                   Missing dependencies:
                   Package ess-openldap-2.3.1 requires ess-openssl= V2.1.1
                   Package kernel-debuginfo requires kernel-debuginfo-common-i686 = 2.6.18-92.el5

3) Based on the above output it was clear that both 'ess-openldap-2.3.1' and 'kernel-debuginfo rpm's
  were installed on the server without resolving underlying dependencies (probably with --nodeps option).

4) Finally we had to clear these stale rpm entries from the database (with --justdb option) for the OS 
  upgrade script to work

                    # rpm -e --justdb ess-openldap-2.3.1
                    # rpm -e --justdb kernel-debuginfo-2.6.18-92.el5


1 comment: