Re: Psyche FAQ (was: Re: Problem with rebuilding rpm database)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 10 Nov 2002, Brian K. Jones wrote:

> > > In /var/lib/rpm delete __db.00{1,2,3} and try again.
> >
> > 	I definitely nominate this for the FAQ.
> 
> I think something like this belongs in the FAQ, but these kinds of answers 
> piss me off, because they fail to explain *why* you need to do this.  If this 
> can be explained, I'd love to add it in with the explanation.  

There is a good reference other posts on the list have mentioned at
http://www.rpm.org/hintskinks/repairdb/

I would phrase the FAQ entry something like this.

Q. I can't upgrade any packages, run up2date or rpm. What is wrong?

A. The RPM database sometimes gets stuck. One cause of this problem is
when a process working on the RPM database is killed, which leaves lock
files in place, limiting what further processes can do to the database. So
make sure such a process really is stuck before killing it - if a process
is using much CPU time (eg. as reported by top) it is probably still doing
useful work. 
To free a stuck database;
1. Make sure there are no processes trying to access the rpm database
(such as rpm, up2date, redhat-config-packages)
2. Remove the rpm lock files, rm /var/lib/rpm/__db* .
 Rebooting will do stages 1. & 2. automatically (2. is done in the startup
scripts). In many cases these are enough to free the stuck database. If
there are still problems;
3. Take a safety copy of the database, in case things go wrong. (eg.
cp -r /var/lib/rpm /var/lib/rpm.copy ).
4. Try rebuilding the database (from the Packages data file) by running
rpm --rebuilddb .
 If the database still doesn't work, and the db4-utils package was
installed; 
5. Run cd /var/lib/rpm; db_verify Packages . This checks the underlying
data format of this file.
6. If there are errors, you can rebuild the Packages file from the good
records by running
cp Packages Packages.orig; db_dump Packages.orig | db_load Packages
and repeat step 4.
 There is a good reference for this procedure at
http://www.rpm.org/hintskinks/repairdb/

	Michael Young



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux