RPM Community Forums

Mailing List Message of <rpm-users>

Re: error: cannot open Packages database in /var/lib/rpm

From: <spam.spam.spam.spam@free.fr>
Date: Wed 27 May 2009 - 21:49:57 CEST
Message-ID: <1243453797.4a1d9965af36a@imp.free.fr>
Selon Jeff Johnson <n3npq@mac.com>:

>
> On May 26, 2009, at 1:50 PM, spam.spam.spam.spam@free.fr wrote:
>
> > Hello,
> >
> > I have installed : rpm 5.1.9, bash 3.2, db-4.4.20, ncurses-5.6,
> > beecrypt-4.1.2,
> > gcc-4.4.0 and glibc-2.9 in a directory.
> >
>
> (aside)
> I recommend either applying patches to db-4.4.20 (or using
> newer Berkeley DB, at least db-4.5.x) if you have any
> flexibility choosing the version of Berkeley DB whatsoever.
>
> The issue is that "stale lock" handling can be automated
> if db-4.4.20+patch or later is used.
>
> OTOH, if you cannot change Berekeley DB, an rpmdb for
> almost any version of Berkeley DB can be achieved
> by changing rpmdb configuration and how rpm is built.
> RPM needs (and uses) almost none of what Berkeley DB actually
> can provide atm.
>
> You will need to do "rm -f /var/lib/rpm__db*" manually
> if/when there are stale locks using older versions of Berkeley DB.
>
> > I did :
> > sudo chroot /my/directory
> >
> > Then I try to install a RPM package :
> > # rpm -i 8Kingdoms-1.1.0-6.fc9.i386.rpm
> > error: cannot open Packages database in /var/lib/rpm
> > warning: 8Kingdoms-1.1.0-6.fc9.i386.rpm: Header V3 DSA signature:
> > NOKEY, key ID
> > 4f2a6fd2
> > error: cannot open Packages database in /var/lib/rpm
> >
> > It's a problem...
> > So I did :
> > # rpm --initdb
>
> This command doesn't do anything important. Won't hurt, won't help,
> anything at all.
>
> >
> > # rpm --rebuilddb
> > error: cannot open Packages database in /var/lib/rpm
> >
>
> K. What I need to see (first) is what RPM reports with -vv
> added. All I can tell from the above is "doesn't work".
> I'm specifically looking for (and will be displayed with -vv)
> how the rpmdb is being opened in messages like this:
>
> D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
> D: locked   db index       /var/lib/rpm/Packages
>
> that should be displayed almost immediately.
>
> > I am root:root user:group and the rigts on /var/lib/rpm are :
> > $ ls -ld tmp/var/lib/rpm
> > drwxrwxrwx 2 root root 48 2009-05-26 15:39 tmp/var/lib/rpm
> >
> > The directory /var/lib/rpm stay empty...
> >
>
> What is empty? No files in the directory? Then you likely
> have built/configured rpm incorrectly.
>
> > Why I got these errors?
> >
>
> Dunno yet.
>
> 73 de Jeff
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> User Communication List                             rpm-users@rpm5.org
>

OK so first, this is what I get with verbose mode :

# rpm --rebuilddb -vv
D: pool ts:     created size 720 limit -1 flags 0
D: pool db:     created size 180 limit -1 flags 0
D: dbiOpen: _dbiapi failed
error: cannot open Packages database in /var/lib/rpm
D: pool tsi:    created size 24 limit -1 flags 0
D: pool tsi:    reused 1, alloc'd 1, free'd 1 items.
D: pool ts:     reused 0, alloc'd 1, free'd 1 items.
D: pool db:     reused 0, alloc'd 1, free'd 1 items.

I use now newer versions of softwares :
bash-4.0, db-4.7.25, glibc-2.9, gcc-4.4.0, rpm-5.1.9, ncurses-5.6, popt-1.15 (I
forgot it in the last email!), beecrypt-4.1.2.

And you can see I get the same error :

# rpm -i 8Kingdoms-1.1.0-6.fc9.i386.rpm
error: cannot open Packages database in /var/lib/rpm
warning: 8Kingdoms-1.1.0-6.fc9.i386.rpm: Header V3 DSA signature: NOKEY, key ID
4ebfc273
error: cannot open Packages database in /var/lib/rpm
bash-4.0# rpm --initdb
bash-4.0# rpm -i 8Kingdoms-1.1.0-6.fc9.i386.rpm
error: cannot open Packages database in /var/lib/rpm
warning: 8Kingdoms-1.1.0-6.fc9.i386.rpm: Header V3 DSA signature: NOKEY, key ID
4ebfc273
error: cannot open Packages database in /var/lib/rpm
bash-4.0# rpm --rebuilddb
error: cannot open Packages database in /var/lib/rpm
bash-4.0# rpm -i 8Kingdoms-1.1.0-6.fc9.i386.rpm
error: cannot open Packages database in /var/lib/rpm
warning: 8Kingdoms-1.1.0-6.fc9.i386.rpm: Header V3 DSA signature: NOKEY, key ID
4ebfc273
error: cannot open Packages database in /var/lib/rpm

Why I got this error message?
Received on Wed May 27 21:50:21 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.