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: Thu 28 May 2009 - 15:23:46 CEST
Message-id: <1984A4F0-A595-4478-9179-71CEC39967AB@mac.com>

> I have written in the previous mail (see up):
> 'error: unpacking of archive failed: cpio: Bad magic'
> This is an error I get. And that's the reason why I thought I need  
> CPIO. But
> CPIO isn't mandatory, so... Why this error?

MANDATORY (of course) depends on a context, and there are
different contexts of reference.

wrto cpio, the usage case for cpio in RPM is payload extraction using  
(or rpm2cpio.sh) as in
	rpm2cpio foo*.rpm | cpio -dim
RPM itself doesn't need that functionality, but your Slackware chroot  
benefit from being able to extract files from *.rpm packages without
using RPM.

Dunno what the failure is.

The magic check is attempted when the payload is first opened.

A failure is typically from truncated *.rpm input or (likelier
in your case) rpm being mis-built. Check what compressions
you have built into RPM.

	rpm2cpio foo*.rpm | cpio -dim
is one easy test of the payload extraction.

There's also "-vv --fsmdebug" options that will display
diagnostic information regrading payload unpacking.
Likely --fsmdebug won't help with "bad magic", all you
will see is that, indeed, the magic is bad.

There are some small toy *.rpm's that are in RPM cvs (
see the tests/ subdirectory) that can be used for simple

The tests/devtool-sanity-1.0-1.src.rpm package in particular
can be built and an install attempted to diagnose your problem.

73 de Jeff
Received on Thu May 28 15:24:10 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.