One shouldn't be removing the Packages file, just removing __db.* file is enough to resolve the reported error.
Copy the Packages file from backup and retry again.
------------------------------
SANGAMESH
------------------------------
Original Message:
Sent: Thu July 17, 2025 02:23 AM
From: Ishwarya Bala
Subject: rpmdb: Thread/process 37487260/1 failed: Thread died in Berkeley DB library
We are unable to update rpm's in one of the AIX server we are getting error like
error: rpmdb: Thread/process 11927852/1 failed: Thread died in Berkeley DB library
error: db4 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db4 - (-30974)
error: cannot open Packages database in /opt/freeware/packages
error: rpmdb: Thread/process 11927852/1 failed: Thread died in Berkeley DB library
error: db4 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db4 - (-30974)
error: cannot open Packages database in /opt/freeware/packages
Then we tried to rebuild the rpm with the below commands
645 cp -rp /opt/freeware/packages /opt/freeware/packages.bak
646 cd /opt/freeware/packages
647 rm -f __db.* Packages
648 rpm --rebuildb
649 which rpm
650 /usr/bin/rpm --rebuilddb
651 rpm -qa
After that we are unable to see any rpms when we execute rpm -qa.
------------------------------
Ishwarya Bala
------------------------------