How to solve Installation failure of "Cannot match package for regexp name {0}. Available packages:"
While installing HDP components using Ambari some times it fails with below errors.
raise Fail("Cannot match package for regexp name {0}. Available packages: {1}".format(name, self.available_packages_in_repos))
resource_management.core.exceptions.Fail: Cannot match package for regexp name zookeeper_${stack_version}. Available packages: []
What does this mean? basically Ambari is unable to find the packages. the possible reasons can be,
Reason1: Is that host already have that binaries installed? If it is already installed using different repo-name then Ambari would not be able to determine those binaries. You can find out that by running
yum list installed | grep zookeeper
This tells using which tag/repo it was installed (look for specific HDP version).
If you find entry and it was installed different tag/repo then manually remove above packages and attempt to install again.
Reason2: Its possible that provided URL does not have those binaries. you can determine by running below command
yum list available | grep zookeeper
If it is not returning any list for that version then check tag/repoURL defined in Ambari to make sure it is correct.

