Red Hat This forum is for the discussion of Red Hat Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-21-2004, 02:33 AM
|
#1
|
Member
Registered: May 2004
Distribution: Fedora Core 6
Posts: 36
Rep:
|
I lost my rpm database
I lost my rpm database (RH 7.1). (Don't ask me how that happened, because I will lie about it.)
Is there any simple program (a shell program, or maybe in Perl) to regenerate it?
updatedb doesn't work.
All the files in /var/lib/rpm are still there, but I get error messages from rpm like:
error: cannot get exclusive lock on /var/lib/rpm/Packages
error: cannot open Packages index using db3 - Operation not permitted (1)
error: cannot open Packages database in /var/lib/rpm
Is there any place on the web where I can find all previous versions that were ever made of any libraries/packages?
Can different versions of the same library be installed side by side? Sometimes I need a certain version of a library to install some software. Some other software needs an older version. Of this other software there may not be any newer version yet that uses the newest version of the library. Can yum sort this out?
Janneman.
Last edited by Janneman; 10-21-2004 at 02:51 AM.
|
|
|
10-21-2004, 09:48 AM
|
#2
|
LQ Newbie
Registered: Oct 2004
Location: Western USA
Distribution: Fedora,Suse,Redhat,Puppy,etc.
Posts: 13
Rep:
|
Re: I lost my rpm database
Quote:
I lost my rpm database (RH 7.1). (Don't ask me how that happened, because I will lie about it.)
Is there any simple program (a shell program, or maybe in Perl) to regenerate it?
updatedb doesn't work.
|
No need to lie - it's happened to me multiple times, and more than once with no fault of my own.
And the program is rpm --rebuilddb.
Quote:
Ierror: cannot get exclusive lock on /var/lib/rpm/Packages
error: cannot open Packages index using db3 - Operation not permitted (1)
error: cannot open Packages database in /var/lib/rpm
|
The lock error indicates that you probably have an version of rpm running, use killall -v -0 rpm rpmbuild to find the process ID, then use ps -fp pid to determine the pty/tty where it's running and try to kill it (easily at first: INT, HUP, TERM, QUIT, KILL).
But likely the database content is hosed. What has worked for me (and YMMV) is to remove/rename the /var/lib/rpm/Packages file, then run rpm --rebuilddb -- which should run fairly fast (I don't remember, but a small number of minutes, certainly not for hours).
Good luck,
NVRAM
|
|
|
10-21-2004, 10:15 AM
|
#3
|
Member
Registered: May 2004
Distribution: Fedora Core 6
Posts: 36
Original Poster
Rep:
|
Thanks, but with rpm --rebuilddb I get the message:
error: cannot open Packages index
and with rpm -qa:
error: cannot open Packages index using db3 - No such file or directory (2)
Janneman.
|
|
|
10-21-2004, 01:00 PM
|
#4
|
LQ Newbie
Registered: Oct 2004
Location: Western USA
Distribution: Fedora,Suse,Redhat,Puppy,etc.
Posts: 13
Rep:
|
Quote:
Thanks, but with rpm --rebuilddb I get the message:
error: cannot open Packages index
and with rpm -qa:
error: cannot open Packages index using db3 - No such file or directory (2)
|
Hmm, similar results here on a healthy system (after backup!).
Using rpm --initdb alleviates the errors, but after that rpm --rebuilddb doesn't do much, either. Perhaps it wasn't the "Packages" file that I renamed? I simply cannot remember, it was months ago. Sorry I can't help -- I remember my level of frustration when it's happened.
If I remember, I'll scan my history stack on the system where I last had this problem, but I wouldn't bet on any results, though.
|
|
|
10-21-2004, 04:03 PM
|
#5
|
Senior Member
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084
Rep:
|
Not trivial. Especially not, because you didn't add enough details. E.g. what is left in /var/lib/rpm?
Did Red Hat Linux 7.1 have /var/log/rpmpkgs already? (I don't remember) -- In case it does, save a copy of that file, because it contains a list of the packages which were found in your RPM database the previous night. Using that list, one can recreate the RPM database by reinstalling all the packages with options --justdb --noscripts --notriggers after initializing a new and empty database. In case you don't have that list, don't hope that you can recreate the database without having a backup.
|
|
|
10-22-2004, 06:02 AM
|
#6
|
Member
Registered: May 2004
Distribution: Fedora Core 6
Posts: 36
Original Poster
Rep:
|
rpm core dump
When I try to install something with rpm, I get a core dump,e.g.:
rpm -ivh --justdb --noscripts --notriggers /mnt/cdrom/RedHat/RPMS/glibc-common-2.2.2-10.i386.rpm
Preparing... ########################################### [100%]
Segmentation fault (core dumped)
yum won't work because I have an empty database.
Can I download an rpm database from anywhere which contains the basic RH 7.1 packages and try to work from that?
It must be possible to figure out what's installed without this stupid database, mustn't it?
Janneman.
Last edited by Janneman; 10-22-2004 at 06:22 AM.
|
|
|
12-15-2004, 12:46 PM
|
#7
|
LQ Newbie
Registered: Dec 2004
Posts: 1
Rep:
|
RE: I lost my rpm database
I also had this issue after I "torqued" my dbase file. I was able to re-create the Packages file after removing /var/lib/rpm/Packages; recreating an empty dbase with rpm --initdb. Then using the rpm command suggested with the packages listed in /var/log/rpmpkgs, but adding the --nodeps flag.
It took me a couple tries to get everything back. Once yum was back on line, I was able to check my rpm list against "yum install"
Thanks!
|
|
|
All times are GMT -5. The time now is 03:53 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|