redhat-config-packages problem + other

Rick Stevens rstevens at vitalstream.com
Mon Jul 12 18:16:13 UTC 2004


Graeme Nichols wrote:
> Hello Folks, I seem to be having a problem with the rpm database or
> something because redhat-config-packages no longer runs and I cannot
> figure out what may be wrong. Running it from the command line results
> in the following:_
> 
> [graeme at barney graeme]$ redhat-config-packages
> rpmdb: /var/lib/rpm/Packages: unsupported hash version: 8
> error: cannot open Packages index using db3 - Invalid argument (22)
> Traceback (most recent call last):
>   File "/usr/share/redhat-config-packages/MainWindow.py", line 159, in ?
>     hdlist.mergeRpmDb()
>   File "/usr/share/redhat-config-packages/hdrlist.py", line 32, in
> mergeRpmDb
>     db = rpm.opendb(0, instPath)
> rpm404.error
> 
> This output seems to me to indicate a python/gnome problem. My
> experience with python, gnome, pygtk etc. has taught me that the python,
> gnome, pygtk etc. is a complete dogs breakfast with every upgrade of the
> different libraries/packages scattering the components around various
> different locations to the previous version creating all sorts of
> problems similar to the error above. The developers don't appear to have
> heard of backward compatibility or even consistency.
> 
> I run gramps and tried to upgrade a particular library/package to take
> advantage of a plug-in. The library/package rpm installed with no
> warnings or dependency problems but broke python and gramps because the
> updated library/package installed all it's modules in a different
> location to where python and gramps were expecting to find them. I had
> to backtrack to fix it all. No big deal but a RPITB.
> 
> I also run Gnucash which has a perl plug-in for getting stock quotes.
> When I upgraded Gnucash a few weeks ago and tried to get stock quotes I
> had to upgrade a whole smash of stuff related to the Finance::Quote perl
> module. I don't believe this has caused my problem, but, hey, who knows?
> 
> But back to the problem... I rebuilt the rpm database twice and both
> times it went to completion without errors. On RH8 I don't have any
> '__db.0n' files in /var/lib/rpm, only the following:-
> 
> [graeme at barney graeme]$ ls -la /var/lib/rpm
> total 83184
> drwxr-xr-x    2 rpm      rpm          4096 Jul 12 14:37 .
> drwxr-xr-x   30 root     root         4096 Jul 12 12:11 ..
> -rw-r--r--    1 rpm      rpm      10563584 Jun 12 15:28 Basenames
> -rw-r--r--    1 rpm      rpm         12288 Jun 12 15:26 Conflictname
> -rw-r--r--    1 rpm      rpm       1433600 Jun 12 15:28 Dirnames
> -rw-r--r--    1 rpm      rpm      10575872 Jun 12 15:28 Filemd5s
> -rw-r--r--    1 rpm      rpm         28672 Jun 12 15:57 Group
> -rw-r--r--    1 rpm      rpm         20480 Jun 12 15:57 Installtid
> -rw-r--r--    1 rpm      rpm         81920 Jun 12 15:57 Name
> -rw-r--r--    1 rpm      rpm      40337408 Jun 12 15:57 Packages
> -rw-r--r--    1 rpm      rpm        331776 Jun 12 15:57 Providename
> -rw-r--r--    1 rpm      rpm         98304 Jun 12 15:57 Provideversion
> -rw-r--r--    1 root     root        12288 Jul 12 11:55 Pubkeys
> -rw-r--r--    1 rpm      rpm         12288 Jun 12 15:57 Pubkeys.old
> -rw-r--r--    1 rpm      rpm        405504 Jun 12 15:28 Requirename
> -rw-r--r--    1 rpm      rpm        204800 Jun 12 15:28 Requireversion
> -rw-r--r--    1 root     root     25080710 Jul 12 11:54 rpm_backup.zip
> -rw-r--r--    1 rpm      rpm        167936 Jun 12 15:28 Sha1header
> -rw-r--r--    1 rpm      rpm         86016 Jun 12 15:28 Sigmd5
> -rw-r--r--    1 rpm      rpm         12288 Jun 12 15:28 Triggername
> 
> I am no programmer but from the error message I take it the problem
> occurs in the python module hdrlist.py which calls the function
> mergeRpmDb which then fails on the first assignment (db = rpm.opendb(0,
> instPath))
> 
>>From now on I am lost. Has anyone any idea what may have become
> corrupted? Is there a compatibility problem in the various python etc
> libraries/packages caused by one or more being upgraded independently?
> (This would have to have happened because of some automated upgrade as I
> haven't done any upgrades myself)
> 
> For what its worth the following is the code in hdrlist.py down to line
> 32 where the error occurs:-
> 
> #
> # hdrlist.py - functions for dealing with header lists
> #
> # Based on code originally from anaconda's comps.py
> #
> # Copyright 2002 Red Hat, Inc.
> #
> 
> import os, sys
> import rpm404 as rpm
> import method
> from comps import Package
> 
> if os.environ.has_key("RCPUPGRADE") and os.environ["RCPUPGRADE"] == "1":
>     ALLOWUPGRADE = 1
> else:
>     ALLOWUPGRADE = 0
> 
> class HeaderList(dict):
>     def selected(self):
>         l = []
>         keys = self.keys()
>         keys.sort()
>         for name in keys:
>             if self[name].isSelected():
>                 l.append(self[name])
>         return l
> 
>     def mergeRpmDb(self, instPath = "/"):
>         installedmethod = method.InstalledPackageMethod()
> 
>         db = rpm.opendb(0, instPath)
>         i = db.firstkey()
>         while i is not None:
> 
> Hoping someone can help.

This problem has been documented many times.  To fix it, as root:

	# cd /var/lib/rpm
	# rm -f __db*    (that's two underscores)
	# rpm --rebuilddb

Then RPM should work properly.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-         Microsoft Windows:  Proof that P.T. Barnum was right       -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list