RPM Community Forums

Mailing List Message of <rpm-users>

RPM got currupt

From: Janis Elmeris <janis.elmeris@intelligentsystems.lv>
Date: Tue 16 Oct 2012 - 20:30:39 CEST
Message-ID: <507DA7CF.20605@intelligentsystems.lv>
Hello!

I accidentally upgraded a package with a lot of dependencies inluding 
rpm and db, and at some point also aborted the upgrade, and now I have a 
broken RPM. :(

Right after sending the abort command I got these error messages:

rpmdb: unrecognized name-value pair: set_create_dir
rpmdb: unrecognized name-value pair: set_create_dir
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: //var/lib/rpm: open rpm database failed
Aborted (core dumped)

I've done rm /var/lib/rpm__db.00* and rpm --quiet -qa (the __db* files 
reappeared) and rpm -qa gives me the list of installed packages all 
right, including:
db4.7-4.7.25.4-6.x86_64
db5.3-5.3.21.0-1.x86_64
rpm-5.4.10-18.x86_64

However, rebuilding still complains:

# rpm -vv --rebuilddb
D: pool fd:     created size 392 limit -1 flags 0
D: pool iob:    created size 48 limit -1 flags 0
D: pool mire:   created size 136 limit -1 flags 0
D: pool lua:    created size 64 limit -1 flags 0
D: pool ts:     created size 1200 limit -1 flags 0
D: pool db:     created size 328 limit -1 flags 0
D: pool dbi:    created size 472 limit -1 flags 0
D: rpmdb: cpus 8 physmem 12042Mb
D: opening  db environment /var/lib/rpm/Packages thread:lock:log:mpool:txn
D: opening  db index       /var/lib/rpm/Packages 
create:thread:auto_commit mode=0x2
rpmdb: BDB0641 __db_meta_setup: /var/lib/rpm/Packages: unexpected file 
type or format
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
error: cannot open Packages(0) index: Invalid argument(22)
         DB: Berkeley DB 5.3.21: (May 11, 2012)
error: cannot open Packages database in /var/lib/rpm
D: pool tsi:    created size 48 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.
D: pool dbi:    reused 0, alloc'd 1, free'd 1 items.
D: pool lua:    reused 0, alloc'd 1, free'd 1 items.
D: pool mire:   reused 0, alloc'd 1, free'd 1 items.
D: pool iob:    reused 0, alloc'd 1, free'd 1 items.
D: pool fd:     reused 5, alloc'd 1, free'd 1 items.
D: exit code: -2

In addition, when I run the server package manager (poldek, which BTW 
also decided to get upgraded along the way), I get an additional 
complaint about Requirename:

BDB0641 __db_meta_setup: /var/lib/rpm/Requirename: unexpected file type 
or format


This is what  has to say about the file formats:

# file /var/lib/rpm/Requirename
/var/lib/rpm/Requirename: Berkeley DB (Hash, version 9, native byte-order)
# file /var/lib/rpm/Packages
/var/lib/rpm/Packages: Berkeley DB (Hash, version 9, native byte-order)


Can someone advice me on how to get the package manager back up, please?

Thanks,
Janis
Received on Wed Oct 17 09:29:39 2012
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.