LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-09-2004, 07:26 AM   #1
ispnepal
LQ Newbie
 
Registered: Jun 2004
Posts: 16

Rep: Reputation: 0
rpmdb problem


hi all:

my rpmdb is not working ...

rpm -qa has no output.


How to solve this?

some outputs:
---
[root@gateway rpm]# ls
Basenames __db.001 __db.002 __db.003 Name Packages Providename Pubkeys
[root@gateway rpm]# rpm -qa
[root@gateway rpm]#
-----------------

Thanks
nisp
 
Old 06-09-2004, 09:35 AM   #2
Philippe
Member
 
Registered: Sep 2003
Location: Chiangmai, Thailand
Posts: 53

Rep: Reputation: 15
Hi,

(All information are from RH9 distribution)

Very strange. Try to rebuild your rpm database

Login as root :

rpmbuild --rebuilddb

You can delete first in /var/lib/rpm the 3 files __db*. No worry

Be sure that there is no other rpm process running. Kill them before if necessary (kill -9 )

ps -ef | grep rpm

Hope this helps.

Philippe
 
Old 06-10-2004, 06:14 AM   #3
ispnepal
LQ Newbie
 
Registered: Jun 2004
Posts: 16

Original Poster
Rep: Reputation: 0
Hi

removed __db* all files

and did:

rpm --rebuilddb

no luck.... it just takes less than 1 sec.....

-----
[root@gateway rpm]# rpm --rebuilddb
[root@gateway rpm]#
--------------------------

[root@gateway rpm]# rpm -qa
[root@gateway rpm]#

---

when i do : rpmbuild --rebuilddb
it says:
---
root@gateway rpm]# rpmbuild --rebuilddb
--rebuilddb: unknown option
--------------




Thanks
Paras
 
Old 06-17-2004, 11:20 AM   #4
kenjon
LQ Newbie
 
Registered: Jun 2004
Location: Sweden
Distribution: RedHat 8
Posts: 4

Rep: Reputation: 0
rpm db problem

I have the same problem, "run database recovery".
I deleted the __db files.
Then I ran the "rpm -qa", I saw a lot of application names scrolling by, but at the end there were some errors:

error: rpmdbNextIterator: skipping h# 933 Header V3 DSA signature: BAD, key ID db42a60e
rpmdb: page 949: illegal page type or format
rpmdb: PANIC: Invalid argument
rpmdb: /var/lib/rpm/Packages: pgin failed for page 949
error: db4 error(-30981) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery
error: db4 error(-30981) from dbcursor->c_close: DB_RUNRECOVERY: Fatal error, run database recovery
error: db4 error(-30981) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery
error: db4 error(-30981) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery
error: db4 error(-30981) from dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery

Running "rpm -qa" again gives me:

rpmdb: region error detected; run recovery.
error: db4 error(-30981) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30981)
error: cannot open Packages database in /var/lib/rpm
no packages


So, what next?
I can't update my programs :-(

/Kent
 
Old 06-18-2004, 05:00 AM   #5
Philippe
Member
 
Registered: Sep 2003
Location: Chiangmai, Thailand
Posts: 53

Rep: Reputation: 15
Hi ,

Removing only the __db files does not help. You must follow the steps given below.

Login as root :

Be sure that there is no other rpm process running. Kill them before if necessary (kill -9 )

ps -ef | grep rpm

Delete first in /var/lib/rpm the 3 files __db*. No worry

rpmbuild --rebuilddb

Hope this helps, as I never had this king of error message.

Philippe
 
Old 06-18-2004, 05:32 AM   #6
kenjon
LQ Newbie
 
Registered: Jun 2004
Location: Sweden
Distribution: RedHat 8
Posts: 4

Rep: Reputation: 0
Thanks, didn't help

[root@mail root]# ps -ef | grep rpm
root 2138 2097 0 12:27 pts/0 00:00:00 grep rpm
[root@mail root]# rm /var/lib/rpm/__db*
rm: remove regular file `/var/lib/rpm/__db.001'? y
rm: remove regular file `/var/lib/rpm/__db.002'? y
rm: remove regular file `/var/lib/rpm/__db.003'? y
[root@mail root]# rpmbuild --rebuilddb
--rebuilddb: unknown option
[root@mail root]# cd /var/lib/rpm
[root@mail rpm]# rpmbuild --rebuilddb
--rebuilddb: unknown option
[root@mail rpm]#
 
Old 06-18-2004, 05:46 AM   #7
Philippe
Member
 
Registered: Sep 2003
Location: Chiangmai, Thailand
Posts: 53

Rep: Reputation: 15
Quote:
root@mail root]# rpmbuild --rebuilddb
--rebuilddb: unknown option
Sorry, try :
[root@p4 root]# rpm --rebuilddb
error: db4 error(16) from dbenv->remove: Device or resource busy

Should work much better, and take about 3 to 5 mn.
The error message is "normal" .

Philippe
 
Old 06-18-2004, 07:26 AM   #8
kenjon
LQ Newbie
 
Registered: Jun 2004
Location: Sweden
Distribution: RedHat 8
Posts: 4

Rep: Reputation: 0
Doesn't work either

It takes less than one second, no error message at all.

The only thing that gives output is to use -vv, but still not working:


[root@mail root]# rpm -vv --rebuilddb
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.2285
D: creating directory /var/lib/rpmrebuilddb.2285
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.2285/Packages create:mpool
D: opening db index /var/lib/rpmrebuilddb.2285/Packages create mode=0x42
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
D: removed db environment /var/lib/rpm/Packages
D: closed db index /var/lib/rpmrebuilddb.2285/Packages
D: closed db environment /var/lib/rpmrebuilddb.2285/Packages
D: removed db environment /var/lib/rpmrebuilddb.2285/Packages
D: removing directory /var/lib/rpmrebuilddb.2285
[root@mail root]#


It recreates the __db files, but they seems to be empty, "rpm -qa" gives nothing at all. So they need to be "populated" with info about my installed programs....
 
Old 06-18-2004, 07:33 AM   #9
Philippe
Member
 
Registered: Sep 2003
Location: Chiangmai, Thailand
Posts: 53

Rep: Reputation: 15
man rpm give this :

The general form of an rpm rebuild database command is

rpm {--initdb|--rebuilddb} [-v] [--dbpath DIRECTORY] [--root DIRECTORY]

Use --initdb to create a new database, use --rebuilddb to rebuild the
database indices from the installed package headers.

I think that using the --initdb could maybe work. Sorry but I have no more idea afterthis ;-)

Hope this helps,

Philippe
 
Old 06-18-2004, 07:40 AM   #10
kenjon
LQ Newbie
 
Registered: Jun 2004
Location: Sweden
Distribution: RedHat 8
Posts: 4

Rep: Reputation: 0
Works!

RedHat 8.0 had some files in the /usr/bin I wasn't aware of (db_verify, dup, load).
No it seems to be OK again.

Thanks for the help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling rpmdb-redhat louisb Linux - Enterprise 1 09-16-2005 04:37 PM
fedora4 rpmdb? james.farrow Fedora 9 06-25-2005 06:08 PM
Help me to recover my rpmdb J_Szucs Linux - General 1 09-09-2004 09:39 AM
RPMDB Recovery inTUXicated Linux - General 3 02-10-2004 10:33 AM
rpmdb error acid_kewpie Linux - General 0 02-02-2002 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration