Re: Restore RPM database?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Alan Dayley
Date:  
To: plug-discuss
Subject: Re: Restore RPM database?
On Sunday 06 February 2005 12:29 pm, Craig White wrote:
> > as a means of a bookmark - this may be of use to you but I think this is
> > more to the point of - if normal methods of rebuilddb aren't going to
> > work, this probably has the sort of info that you/we need...
> >
> > <http://www.redhat.com/archives/rpm-list/2002-March/msg00072.html>
>
> ----
> One more step thru on this...probably a little more succinct...
>
>
> Fix a hoarked rpm database
>
>     Symptom: All rpm commands "hang up"

>
>     Find and kill all processes running rpm or up2date:

>
>         ps ax | grep rpm
>         ps ax | grep up2date

>
>         (Kill them by hand)

>
>     Remove all rpm database lock files:

>
>         rm -f /var/lib/rpm/__db*

>
>     This usually gets things going. If not:

>
>     First make a backup of the database:

>
>         cp -r /var/lib/rpm /var/lib/rpm.copy

>
>     Then rebuild the database

>
>         rpm --rebuilddb

>
>     This takes some time, but if it hangs forever, repeat
>     the "Find and kill rpm" step and proceed with:

>
>         cd /var/lib/rpm
>         db_verify Packages

>
>         (You may need to install db4-utils)

>
>     If db_verify reports errors, try:

>
>         cp Packages Packages.backup
>         db_dump Packages.backup | db_load Packages
>         rpm --rebuilddb

>
>     If all these steps fail, you are in big do-do.


So, this is what it feels like to be in big do-do. ;^\

Thanks for all the tips, Craig. Very helpful as usual!

All the suggestions you gave resulted in no change of the state of the rpm
database. The computer thinks nothing is installed. Below is the output of
the 'rpm --rebuild -vv' command but nothing there jumps out as a problem.

Of course, in the back of my mind I am wondering how the in got in this state
to begin with. I'll be doing a very thorough check of memory and the hard
drive when I do the FC3 install this week.

Thanks for the help but I think I'll just have to leave it to be wiped away
with the new install.

Alan

'rpm --rebuild -vv' command outputl, in case there is a hint here:

# rpm --rebuilddb -vv
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.16296
D: creating directory /var/lib/rpmrebuilddb.16296
D: opening old database with dbapi 3
D: opening  db environment /var/lib/rpm/Packages create:cdb:mpool
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening new database with dbapi 3
D: opening  db environment /var/lib/rpmrebuilddb.16296/Packages create:mpool
D: opening  db index       /var/lib/rpmrebuilddb.16296/Packages create 
mode=0x42
D:  read h#       2 Header sanity check: OK
D:   +++ h#       1 Header sanity check: OK
D: opening  db index       /var/lib/rpmrebuilddb.16296/Name create mode=0x42
D: adding "gpg-pubkey" to Name index.
D: opening  db index       /var/lib/rpmrebuilddb.16296/Group create mode=0x42
D: adding "Public Keys" to Group index.
D: opening  db index       /var/lib/rpmrebuilddb.16296/Providename create 
mode=0x42
D: adding 2 entries to Providename index.
D: opening  db index       /var/lib/rpmrebuilddb.16296/Provideversion create 
mode=0x42
D: adding 2 entries to Provideversion index.
D: opening  db index       /var/lib/rpmrebuilddb.16296/Installtid create 
mode=0x42
D: adding 1 entries to Installtid index.
D: opening  db index       /var/lib/rpmrebuilddb.16296/Pubkeys create 
mode=0x42
D: adding 1 entries to Pubkeys index.
D:  read h#       1 Header sanity check: OK
D:   +++ h#       2 Header sanity check: OK
D: adding "gpg-pubkey" to Name index.
D: adding "Public Keys" to Group index.
D: adding 2 entries to Providename index.
D: adding 2 entries to Provideversion index.
D: adding 1 entries to Installtid index.
D: adding 1 entries to Pubkeys index.
D:  read h#       3 Header sanity check: OK
D:   +++ h#       3 Header sanity check: OK
D: adding "gpg-pubkey" to Name index.
D: adding "Public Keys" to Group index.
D: adding 2 entries to Providename index.
D: adding 2 entries to Provideversion index.
D: adding 1 entries to Installtid index.
D: adding 1 entries to Pubkeys index.
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpmrebuilddb.16296/Pubkeys
D: closed   db index       /var/lib/rpmrebuilddb.16296/Installtid
D: closed   db index       /var/lib/rpmrebuilddb.16296/Provideversion
D: closed   db index       /var/lib/rpmrebuilddb.16296/Providename
D: closed   db index       /var/lib/rpmrebuilddb.16296/Group
D: closed   db index       /var/lib/rpmrebuilddb.16296/Name
D: closed   db index       /var/lib/rpmrebuilddb.16296/Packages
D: closed   db environment /var/lib/rpmrebuilddb.16296/Packages
D: removing directory /var/lib/rpmrebuilddb.16296
#

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss