[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpm database corrupted, how to recover?



While installing some rpms from FreshRPMs.net on my system, rpm
segfaulted.  It seems to have corrupted the database in the process, and
now all rpm commands hang.

How can I recover without reinstalling Fedora?

Here's what it looks like when it hangs:

[root moria rpm]# rpm -v -v --rebuilddb
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.2274
D: creating directory /var/lib/rpmrebuilddb.2274
D: opening old database with dbapi 3
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0

(Nothing happens for a long time.  Killed with -9)

So I moved /var/lib/rpm/Packages to /var/lib/rpm/Packages.corrupt
and then:

[root moria rpm]# rpm -v -v --rebuilddb
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.2334
D: creating directory /var/lib/rpmrebuilddb.2334
D: opening old database with dbapi 3
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening new database with dbapi 3
D: opening  db environment /var/lib/rpmrebuilddb.2334/Packages
create:mpool
D: opening  db index       /var/lib/rpmrebuilddb.2334/Packages create
mode=0x42
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpmrebuilddb.2334/Packages
D: closed   db environment /var/lib/rpmrebuilddb.2334/Packages
D: removing directory /var/lib/rpmrebuilddb.2334

But the resulting Packages list is NOT actually rebuilt, it is empty!

[root moria rpm]# ll Packages*

-rw-r--r--    1 root     root        12288 Nov 12 13:19 Packages
-rw-r--r--    1 rpm      rpm      58630144 Nov 12 12:50 Packages.corrupt

This has been filed in Bugzilla as bug #109913.

-- 
Torrey Hoffman <thoffman arnor net>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]