PASE - rpmdb open failed

By kimot, 27 December, 2022

If you receive error "rpmdb open failed" or "Rpmdb checksum is invalid: pkg checksums" in Open Source Package Management / Installed packages
You can resolve it by this procedure :

do some backup first

cp -avr /QOpenSys/var/lib/rpm/    /home/rpm_backup/backup.rpm.rrrr_mm_dd/

remove rpm db files

rm -f /QOpenSys/var/lib/rpm/__db*

rebuild rpm database

rpm --rebuilddb

clean yum db

yum clean all

 

if yum is locked by another process

bash-5.1$ yum clean all
Existing lock /QOpenSys/tmp/yum.pid: another copy is running as pid 771322.
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...

you can show process detail and end this process

ps -ef | grep 771339
 username 771339      1   0 14:23:12      -  0:13 /QOpenSys/pkgs/bin/python2 /QOpenSys/pkgs/bin/yum -q list installed *

or there is a possibility to delete yum.pid file 
/QopenSys/tmp/yum.pid