Support Questions
Find answers, ask questions, and share your expertise

How to remove an old HDP version

How are you supposed to remove an old version of HDP once you have successfully upgraded to a new version?

The old version is still listed as installed and the "Deregister" button is disabled because "it is installed".

It would be easy to delete the /usr/hdp/[old version] folder but all the packages would still be considered installed by the OS. On the other hand trying to remove the old packages manually on each node is cumbersome and risky.

Leaving behing GBs of data and lots of packages will easily buildup as you upgrade to new versions over the years.

11 REPLIES 11

New Contributor

Hi,

I've used:

yumdb search from_repo HDP-2.6-repo-1* | grep -v from_repo | grep -e . | sort > ~/pkg_to_remove_HDP-2.6-repo-1.lst && yum remove $(cat ~/pkg_to_remove_HDP-2.6-repo-1.lst | tr '\n' ' ' )

Just replace the 'HDP-2.6-repo-1' with the repository name of the version you're want to remove (ie: found /etc/yum.repos.d/ambari-hdp* files).

This method store a file in home directory with the list of packages removed, just in case you need to re-install something.

New Contributor

Not really safe at the end...

While this worked perfectly on client nodes, there seems to be dependencies with more recent versions and there is a risk you remove them if you don't watch carefully before hitting the "Y" key!