UnixPedia : HPUX / LINUX / SOLARIS: How to rebuild corrupted rpm database

Thursday, May 17, 2018

How to rebuild corrupted rpm database


We are getting these alerts because yum database is corrupted on these servers and script tried to execute below command in this step and through alert when it was not successful.


# rpm -qa | grep "[redhatsles]-release"

We can resolve it via below.


# yum list

Error >>
[root@system:/opt/ncsbin/secutil]#
#-> yum list
rpmdb: Thread/process 33524/140223957407648 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root@system:/opt/ncsbin/secutil]#

How to rebuild corrupted RPM database. >> It can be done online without any downtime
# rm -f /var/lib/rpm/__db*
# rpm -–rebuilddb
# yum list    > Check again

# rpm -qa | grep "[redhatsles]-release"

No comments:

Post a Comment