RPM Community Forums

Mailing List Message of <rpm-users>

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

From: Jeff Johnson <n3npq@mac.com>
Date: Tue 26 May 2009 - 20:03:41 CEST
Message-id: <51767BA8-2AEF-4B51-8CAB-5A7DD7342432@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.

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
Received on Tue May 26 20:05:27 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.