Skip to main content
akapratwar
Bronze ⭐️⭐️⭐️
Sep 30, 2017 4:36 AM UTC

RPM Package installation failed during HDP Upgrade

  • Oct 5, 2026 9:17 AM UTC
  • 0 replies
  • 1135 views
  • Translate All

PROBLEM:

When installing RPM during HDP Upgrade on few nodes, the installation fails with the following error:

rpmdb: /var/lib/rpm/Packages: unexpected file format or type
error: cannot open Packages index using db3 - Invalid argument (22)

ROOT CAUSE

This issue occurs when the RPM database is corrupt.

RESOLUTION

To resolve this issue, do the following:

  1. Take a backup of existing RPM database:

    mkdir /root/rpmdb.bak
    cp -rp /var/lib/rpm/__db* /root/rpmdb.bak/

  2. Remove the corrupted RPM database files:

    cd /var/lib/rpm
    rm -rf __db*

  3. Rebuild the RPM database:

    rpm --rebuilddb