The following error message is very misleading, and potentially could be very damaging to an inexperienced user. If an ordinary user tries to remove an rpm package from the command line with 'rpm -e', the following errr is displayed: [mharris@asdf download]$ rpm -e ed cannot open Packages index using db3 - Permission denied (13) --> The rpm database cannot be opened in db3 format. If you have just upgraded the rpm package you need to convert your database to db3 format by running "rpm --rebuilddb" as root. error: cannot open /var/lib/rpm/packages.rpm It is easy at this point for a user to misconstrue the message and attempt to convert his rpm database with db3 somehow. At the very least, the message displayed should say something to the effect of: rpm: error: You must be root to uninstall packages from the system After all, That is the reason rpm can not proceed after all. db3 does not enter into the equation this time, so no error mentioning it should occur. I've seen several people on different lists completely baffled because of this, and I just got hit by it so I thought I'd bugzilla it.
All information in the error message printed is factually correct (although possibly redundant, misleading, verbose and/or chatty). The text is often the only clue for people who have blindly upgraded to the latest version of rpm without any understanding of what they have done. Even if the user "misconstrues" the message, a database rebuild will not hurt a bit. Filtering the message requires a deep understanding of all possible return codes from db1 and db3, for now and for the future, for all possible modes of execution (e.g. rebuilddb is necessarily different) of rpm. FWIW the error message that you desire rpm: error: You must be root to uninstall packages from the system is simply wrong, as the access policy for the rpm database is determined by permissions on directories/files outside of rpm, not by rpm itself.
While I agree with you 100%, I was looking at it from an end user's perspective. It is confusing in this context. I realize the reason for the message from a technical perspective, however if it could be changed in some way with better logic for end users it would be nice. I should have labelled it "enhancement" instead.. oops. ;o)