LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-19-2014, 02:56 PM   #1
deepak_message
Member
 
Registered: Oct 2007
Posts: 175

Rep: Reputation: 17
rpm -qa does not display output


Hi,

I have redhat 5.3. and I aunable to run rpm -qa command even rpm related commands also.
I tried to run below commands but no luck...

rpm --rebuilddb

cd /var/lib/rpm
rpm --rebuilddb
rpm --initdb

rm /dev/urandom
mknod -m 644 /dev/urandom c 1 9


please help to make this run..
 
Old 03-19-2014, 03:10 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
What is actually in the /var/lib/rpm/ directory? The "--rebuilddb" operation just rebuilds the database index files from the data files in that directory. If you do not have the (rather large) "Packages", "Basenames", etc., files there, you do not have the material to rebuild the database.
 
Old 03-19-2014, 03:37 PM   #3
deepak_message
Member
 
Registered: Oct 2007
Posts: 175

Original Poster
Rep: Reputation: 17
[root@abc rpm]# pwd
/var/lib/rpm
[root@abc rpm]# ls -l
total 126744
-rw-r--r-- 1 root root 5435392 Feb 9 21:21 Basenames
-rw-r--r-- 1 root root 12288 Dec 24 21:05 Conflictname
-rw-r--r-- 1 root root 0 Mar 20 00:19 __db.000
-rw-r----- 1 root root 24576 Mar 20 00:36 __db.001
-rw-r----- 1 root root 1318912 Mar 20 00:36 __db.002
-rw-r----- 1 root root 450560 Mar 20 00:36 __db.003
-rw-r--r-- 1 root root 2420736 Feb 9 21:21 Dirnames
-rw-r--r-- 1 root root 5328896 Feb 9 21:21 Filemd5s
-rw-r--r-- 1 root root 24576 Feb 9 21:21 Group
-rw-r--r-- 1 root root 24576 Feb 9 21:21 Installtid
-rw-r--r-- 1 root root 45056 Feb 9 21:21 Name
-rw-r--r-- 1 root root 38993920 Mar 20 00:21 Packages
-rw-r--r-- 1 root root 38993920 Feb 9 21:21 Packages-BAKUP
-rw-r--r-- 1 root root 38993920 Mar 20 00:10 Packages_old
-rw-r--r-- 1 root root 323584 Feb 9 21:21 Providename
-rw-r--r-- 1 root root 102400 Feb 9 21:21 Provideversion
-rw-r--r-- 1 root root 12288 Jul 24 2009 Pubkeys
-rw-r--r-- 1 root root 380928 Feb 9 21:21 Requirename
-rw-r--r-- 1 root root 188416 Feb 9 21:21 Requireversion
-rw-r--r-- 1 root root 81920 Feb 9 21:21 Sha1header
-rw-r--r-- 1 root root 40960 Feb 9 21:21 Sigmd5
-rw-r--r-- 1 root root 12288 Dec 24 21:03 Triggername

Now I getting error... while running rpm -qa command ...
rpmdb: /var/lib/rpm/Packages: unexpected file type or format
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
 
Old 03-19-2014, 06:01 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I'm guessing that the Packages-BAKUP and Packages_old files might be from you trying the RpmRecovery procedure on the rpm.org wiki. If not, have you been through that procedure?

BTW, /dev/urandom should be mode 666, though I doubt that is causing the problem.
Scratch that. It's mode 666 on my RHEL clone systems, but the manpage for urandom says it should be 644.

Last edited by rknichols; 03-19-2014 at 06:11 PM. Reason: add BTW, and take it out again
 
Old 03-19-2014, 07:56 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
well with 5.3 being 7 versions out of date
the normal
Code:
su -
yum clean all 
rpm --rebuilddb
yum update
is out of the question

once you run "--rebuilddb" the old database is removed
you need "yum update" to update what is in the installed DB and the rpm db
 
Old 03-19-2014, 09:57 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by John VV View Post
once you run "--rebuilddb" the old database is removed
you need "yum update" to update what is in the installed DB and the rpm db
Nothing could be farther from the truth!

The "__db.*" files that are removed are just the rpm db lock information files for managing transaction locks on the database. It is all the other files in that directory that are the actual Berkeley DB files.

"yum update" is for updating packages, and will not work if the database of installed packages is broken.
 
  


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
[SOLVED] Rpm kernel output Nikhil_Lagwankar Linux - Newbie 4 08-09-2013 08:39 PM
display output ust Linux - Newbie 1 10-31-2012 03:30 AM
[SOLVED] RPM querytag display all rpm with tag deepak_message Linux - Server 1 08-20-2012 12:43 AM
Output display in c++ gregarion Programming 2 02-08-2010 03:18 PM
Funny rpm output tunedLow Linux - Security 2 10-19-2002 10:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:50 AM.

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