Created on 09-29-2017 09:36 PM - edited 09-16-2022 01:41 AM
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:
mkdir /root/rpmdb.bak cp -rp /var/lib/rpm/__db* /root/rpmdb.bak/
cd /var/lib/rpm rm -rf __db*
rpm --rebuilddb