rpm database corrupted (?) after system crash

Hi,

I’m using OpenSuse 12.3 (32 bit) and just bumped into this unpleasant situation: my system was in the middle of some package updates (through apper) when PC restarted (due to power out…). Atfer restart, apper jumped again with the “invitation” to update something, and those “something” were pgadmin3 and pgadmin3-lang.
Well … now it seems there are 2 (yes, two) versions of pgadmin3 simultaniously installed in my system: old one (1.14.3-2.1.2) and the latest one (1.16.1-2.4.1) !!
Okay, I moved to delete pgadmin3 (and it’s companion with “lang”) with yast2, but yast2 complains that it cannot delete a protected package !! And after I selected “Ignore”,it just left pgadmin3 version 1.14.3 as if it were installed still.
But … at konsole, when I check the presence of the package (rpm -qi pgadmin3) it finds (normally) that there isn’t any pgadmin3 package installed anymore…

So … rpm -qi pgadmin3 returns no package, while yast2 says it is installed.

More of this: now “apper” starts to jump with an update for pgadmin3 … and it drives me crazy, as you’d expect… (what update, since the package is not in the system anymore…)

So, can anyone guide me into some sort of rpm database re-building so it gets rid of this remaining (ghostly) package pgadmin3 ? (of course, after I manage to do that, I could install pgadmin3 as normal, again…)

Thanx.

To rebuild your rpm database, run:

sudo rpm --rebuilddb

Try also to clean libzypp’s caches:

sudo zypper clean -a

Thanx a lot.
I ran both commands: firstly “zypper clean -a” and then “rpm --rebuilddb”
I wouldn’t bet, but I tend to think that solely rpm --rebuilddb is not enough to solve the issue …

Maybe.
But zypper’s cache could be out-of-date after running “rpm --rebuilddb”, so you should clean it afterwards.

On 2013-07-30 21:56, corneld wrote:
> Thanx a lot.
> I ran both commands: firstly “zypper clean -a” and then “rpm
> --rebuilddb”
> I wouldn’t bet, but I tend to think that solely rpm --rebuilddb is not
> enough to solve the issue …

There is a backup copy of the rpm database done every day. While you
decide what to do, make a backup of the backup before it rotates away
and you lose it.

It is the directory “/var/adm/backup/rpmdb/”. If you want to take that
route, use one of the Packages-*.gz files to replace the
“/var/lib/rpm/Packages” file, and inmediately run --rebuildrpm.

Once you do that, you will have to reapply all the package installs and
updates since the backup was taken, because the database says they are
not installed - even if they are.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)