When executing Step 3 of the Ambari installation wizard "Confirm Hosts", Ambari will (by default) SSH to each node and start an instance of the Ambari Agent process. In some cases, it is possible that the local RPM database is corrupted and this registration process will fail.
The error message in Ambari would look something like:
INFO:root:Executing parallel bootstrap
ERROR:root:ERROR: Bootstrap of host myhost.mydomain fails because previous action finished with non-zero exit code (1)
ERROR MESSAGE: tcgetattr: Invalid argumentConnection to myhost.mydomain closed.
STDOUT: Error: database disk image is malformed
Error: database disk image is malformedDesired version (188.8.131.52) of ambari-agent package is not available.
tcgetattr: Invalid argumentConnection to myhost.mydomain closed.
In this case, the local RPM database is malformed and all actions to alter the installed packages on the system will fail until the database is rebuilt.
This can be done by the following commands as root on the host reporting the error: