Robinson Tiemuqinke writes:
3, feed the obsolete versions into "rpm -e --justdb":
rpm -e --justdb `cat /var/tmp/obsoletes`
I would not recommend the --justdb option. It many cases, remnants of the
old package are still there, and should really be removed. With --justdb,
the RPM database gets updated, but the old, obsolete files, may still be
there and could cause some confusion in the future.
The procedure I used was:
1. Run rpm --rebuilddb, to make sure the RPM database is clean
2. rpm -q -a --queryformat '%{NAME}.%{ARCH}\n' | sort | uniq -c | sort -n
This gave me the list of all packages and how many versions of each are
installed. Some packages with >1 count, namely kernel and gpg-pubkey, are
legitimate.
3. I took all the rest, ran rpm -q on them all, to get the actual versions
that were installed, according to rpm. And manually edited the output to
contain only the obsolete versions, then fed the results to plain old 'rpm
-e'.