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)
This issue occurs when the RPM database is corrupt.
To resolve this issue, do the following:
cp -rp /var/lib/rpm/__db* /root/rpmdb.bak/
rm -rf __db*