RPM corrupted, rpm --rebuilddb fails and there is data in the /var/lib/rpm directory

RPM corrupted, rpm --rebuilddb fails and there is data in the /var/lib/rpm directory

Post by Jean-Paul Apthor » Fri, 21 Feb 2003 00:53:53



In an attempt to fix up a curruped RPM database when installing the
ncurses package I seemed to have lost my whole database.

I backed up /var/lib/rpm before I did anything.

when installing the ncurses package I received the message

=========================
rpm -i ncurses-5.2-23mdk.i586.rpm

error: failed dependencies:
         /sbin/ldconfig   is needed by ncurses-5.2-23mdk
         ld-linux.so.2   is needed by ncurses-5.2-23mdk
         libc.so.6   is needed by ncurses-5.2-23mdk
         libgpm.so.1   is needed by ncurses-5.2-23mdk
         libncurses.so.5   is needed by ncurses-5.2-23mdk
         libc.so.6(GLIBC_2.0)   is needed by ncurses-5.2-23mdk
         libc.so.6(GLIBC_2.1)   is needed by ncurses-5.2-23mdk
rpmdb: Bad page number: 2280 should be 3
rpmdb: Bad page number: 2281 should be 4
rpmdb: Bad page number: 2282 should be 5
error: db3 error(-30985) from db->verify: DB_VERIFY_BAD: Database
verification failed
=========================

an attempt at installing libncurses caused rpm to core dump.

I then ran rpm --rebuilddb

This failed to solve the issue. Somewhere between here and a later point
my whole database went. Attempts at running rpm -qa failed to produce
any package listings!

A copy of the backup to its original locaiton of /var/lib/rpm failed to
bring the database back to its original state. rpm -qa failed to show
any packages. A rpm --rebuilddb after copying the backup also failed to
solve the problem.

a ls -lsa of the files in the /var/lib/rpm show that the files contain
the data.

===============================
ls -lsa /var/lib/rpm

total 852
    4 drwxr-xr-x    3 root     root         4096 Feb 19 16:11 ./
    4 drwxr-xr-x   22 root     root         4096 Feb 19 16:09 ../
    4 drwxr-xr-x    2 root     root         4096 Feb 19 16:08 alternatives/
    8 -rw-r--r--    1 root     root        12288 Feb 19 16:08 Basenames
   12 -rw-r--r--    1 root     root        12288 Feb 19 16:08 Conflictname
  580 -rw-r--r--    1 root     root       589824 Feb 19 16:08 Dirnames
   12 -rw-r--r--    1 root     root        12288 Feb 19 16:08 Group
   16 -rw-r--r--    1 root     root        16384 Feb 19 16:08 Installtid
   40 -rw-r--r--    1 root     root      9355264 Feb 19 16:08 Name
    8 -rw-r--r--    1 root     root        12288 Feb 19 16:09 Packages
    8 -rw-r--r--    1 root     root        12288 Feb 19 16:08 Providename
  144 -rw-r--r--    1 root     root       192512 Feb 19 16:08 Requirename
   12 -rw-r--r--    1 root     root        12288 Feb 19 16:08 Triggername
===============================

What happening!?!?

 
 
 

1. Problem with Gnome RPM - Failed to open /var/lib/rpm/packages.rpm

I'm new to Linux and have just installed Redhat 6.1.  I'm using the
Gnome RPM manager and it works great for rpm packages that came on the
6.1 CD, but when I try to load some packages that I've downloaded I
get the Error " Failed to open /var/lib/rpm/packages.rpm"  Am I doing
something wrong, or is there something I need to set?  Any help would
be appreciated.  Thanks

Oh, and one more less important item.  I installed 6.1 with Gnome, How
do I switch to KDE to try it out?  Do I have to re-install?

Dave Hyman

Dave Hyman

2. Browser plug-in or stand-alone app?

3. RPM for Uwin - cannot open file //var/lib/rpm/nameindex.rpm

4. How do I REconfigure Redhat 5.0?

5. RPM Crashes with "//var/lib/rpm/packages.rpm not found"

6. AIX 4.3.3 and 2 cpu′s

7. RPM: cannot open //var/lib/rpm/packages.rpm

8. newbie download questions

9. failed to open //var/lib/rpm/packages.rpm

10. RedHat 3.0.3 Installation - FAILED TO OPEN "/mnt/var/lib/rpm/packages.rpm"

11. How to restore erased rpm data (rpm -e rpm)

12. Recovering the /var/lib/rpm RPM database?

13. /var/lib/rpm/packages.rpm