As a normal user, I can do: [agrajag@loiosh agrajag]$ rpm -qf /bin/bash bash-2.05-8 [agrajag@loiosh agrajag]$ However, as root I get: [root@loiosh agrajag]# rpm -qf /bin/bash rpmdb: Program version 3.3.11 doesn't match environment version 3.3.4 error: db3 error(22) from dbenv->open: Invalid argument error: cannot open Packages index using db3 - Invalid argument (22) [root@loiosh agrajag]# I get the same error when I try any rpm query command as root, such as a -qa, or a normal '-q packagename'
Try rm -f /var/lib/rpm/__db* Reopen this bug if that doesn't work.
That *mostly* works.. When I run 'rpm -qa' as root, it gets to: [root@loiosh agrajag]# rpm -qa psgml-1.2.1-13 libgnomeprint11-0.25-9 trn-3.6-28 <snip> gnumeric-0.67-4 initscripts-6.11-1 cvs-1.11.1p1-3 kudzu-devel-0.99.11-1 Then it just hangs until I hit ^C. When I run rpm -qa as a normal user, it seems to print all the rpms and exit cleanly. Also: [root@loiosh agrajag]# rpm -q rpm rpm-4.0.3-0.84 [root@loiosh agrajag]#
The next step is rpm --rebuilddb
I ran rpm --rebuilddb as root, and it just sat there.. no heavy disk access or anything... at the suggestion of Jeremy Katz, I straced it, found it was just doing selects, then stopped the rpm process and did the rm -f /var/lib/rpm/__db* *again*. Now everything seems to be working fine as far as I can tell.. however I do think it is a bug that I even had to remove these files once.
Fixed in rtpm-4.0.3-0.88.