22 Nov 2018

Error rpmdb open failed on running yum update

Facing issues when updating packages on RHEL System? Error logs similar to below log that we encountered on one of our CentOS systems.

error: db5 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db5 – Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

This error occurs when rpm database is corrupted on the system. No need to worry, as there is an easy fix which will be discussed below in simple steps.

Requirements

  • Root user access to the Machine

Procedure

  1. Log in to the machine using root account where you are facing the issue.
  2. Stash all the headers files on which yum uses for dependency resolution
    yum clean headers
  3. Clean yum packages cache
    yum clean packages
  4. Clean metadata
    yum clean metadata
  5. Clean dbcache
    yum clean dbcache
  6. Clean remaining things
    yum clean all
  7. Remove clean all RPM database files
    rm -f /var/lib/rpm/__db.*
  8. Rebuilt RPM Database
    rpm -vv –rebuilddb
  9. Now run the update command
    yum update

With this rpmdb open failed error will be fixed.