Installing Vault using the package manager on RHEL 9 for SAP fails with the following error:
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
dnf install vault-enterprise
Hashicorp Stable - x86_64
Errors during downloading metadata for repository 'hashicorp':
- Status code: 404 for https://rpm.releases.hashicorp.com/RHEL/9.0/x86_64/stable/repodata/repomd.xml
Error: Failed to download metadata for repo 'hashicorp': Cannot download repomd.xml:
Cannot download repodata/repomd.xml: All mirrors were tried
Prerequisites
- RHEL 9.x for SAP
- Vault Enterprise (All versions)
Cause
The $releasever
variable which is computed by yum
or dnf
returns version 9.0 instead of version 9 which is being returned by the other RHEL 9 distributions.
The $releasever
variable is used in the /etc/yum.repos.d/hashicorp.repo
configuration file. The https://rpm.releases.hashicorp.com/RHEL/9.0/$basearch/stable
repository doesn't exist.
Solution
The easiest way to address the issue is to hardcode the version number (9) in the /etc/yum.repos.d/hashicorp.repo
configuration file by replacing the following line:
-
baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/stable
with:
-
baseurl=https://rpm.releases.hashicorp.com/RHEL/9/$basearch/stable
Outcome
Installation of Vault Enterprise should now be possible using:
dnf install vault-enterprise
Additional Information
-
Vault Documentation: Installation
- Vault Website: Official Packaging Guide