Please use yum to remove those components. If you see this bug, hadoop components have not been installed yet.
yum remove ambari-agent
yum remove ambari-server
yum remove postgresql
Please remove old repo file under /etc/yum.repos.d.
The HDP 1.2.2 has released. Please follow the new instruction to install HDP 1.2.2 which will fix the issue you saw.