Issue
After adding the HashiCorp RPM repository with sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
the following error may appear in some cases
https://rpm.releases.hashicorp.com/RHEL/7Server/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Cause
This is due to a mismatch in the $releasever
variable on some RHEL platforms. The HashiCorp RPM repository expects a static number, i.e. 7
for the release version, but some platforms use 7Server
.
Solution
To fix this issue, the /etc/yum.repos.d/hashicorp.repo
file will need to be edited to replace $releasever
with just the RHEL release number, i.e. 7
. This can be quickly done with sed
like so: sudo sed -i -e "s/\$releasever/7/g" "/etc/yum.repos.d/hashicorp.repo"
. After the file has been edited, the repo data should be fetched appropriately and the packages may be installed.
Related Links
https://discuss.hashicorp.com/t/404-error-from-rhel-repo/14427/13