LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why is rpm broken? (https://www.linuxquestions.org/questions/linux-software-2/why-is-rpm-broken-128972/)

mansonmuni 12-26-2003 01:37 AM

Why is rpm broken?
 
RH9 rpm version 4.2

On several distros I have found the need to rebuild my rpm database. Is this a normally occuring event or do I provoke it? Today I rebuilt it twice! Whenever rpm hangs, it usually results in my having to move my /var/lib/rpm/__db.00* files out of the way and do rpmdb --rebuilddb in order to get it to work again. Tonight, I get this message after I did it:

[root@localhost rpm]# rpmdb --rebuilddb
error: db4 error(16) from dbenv->remove: Device or resource busy

rpm is working but this doesn't sound good. Am I doing the right thing when I have this problem? What are the possible complications of the --rebuilddb option?


rpm had locked up after a simple erase operation. It seems my system indicates there are multiple installations of some packages -- initscripts for example:

[root@localhost rpm]# rpm -q initscripts
initscripts-7.14-1
initscripts-7.28-1

So I try to erase the 7.14 version with rpm -e and it just hangs. Well obviously there aren't really multiple versions of initscripts on my machine, but rpm thinks there are. But it doesn't know how to get rid of what isn't there. After it hangs, its broken. The only way to get it to work again that I know of is to rebuild the db files. It still thinks it has multiple initscripts installed, but at least it works.

Where is rpm getting this erroneous information? Header files? I don't have a initscripts*.hdr file anywhere on my box that I can find.

Why is rpm broken like this? Is it me?

jailbait 12-26-2003 02:19 PM

"Why is rpm broken like this?"

I think that the problem is that at some time in the past you ended up with multiple registrations of the same rpm package and have never cleaned things up all the way. I have had the problem of multiple registrations before and have a method to clean them out of the rpm data base:

First create a listing of every rpm in the rpm data base:
rpm -qa | sort > /root/every.rpm.txt

Look through every.rpm.txt and find every rpm that appears more than once. Collect the current version of these rpm packages someplace handy. Check to make sure that none of the packages are needed by the rpm package:
rpm -qR rpm

Get rid of the problem rpms by issuing:
rpm --nodeps -e problemname
over and over until rpm tells you that the rpm is not installed

Then install the current version of that rpm with:
rpm -if /handyplace/rpmname.rpm

After you have cleaned out all of the duplicate names then run:
rpm --rebuilddb
and it should do a neat job of rebuilding your data base this time.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

mansonmuni 12-26-2003 03:48 PM

Ok Steve. Thanks. I'm working on that process. Could take a while since I've got about 1400 packages installed. Nevertheless, I can do it. But what about these kind of entries in my everypackage.txt file:
automake14-1.4p6-5.1
automake15-1.5-6
automake-1.6.3-5

Isn't that three separate entries for automake with some default renaming scheme for duplicates? Shouldn't the 14 and 15 versions be cleaned out too?

What is rpm doing here and why?

Glen

jailbait 12-26-2003 04:55 PM

"What is rpm doing here and why?"

The version number is to the right of the minus sign. I think that you have three different packages (in the rpm sense) installed:
automake
automake14
automake15

They are not duplicates. The older automakes are there in case you have old packages to install that need the old versions of automake. The differences are explained with:
rpm -qi automake
rpm -qi automake14
rpm -qi automake15

These would be duplicate names:
automake-1.4p6-5.1
automake-1.5-6
automake-1.6.3-5



___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites


All times are GMT -5. The time now is 02:46 PM.