Problem
When following the Terraform Enterprise Installation with SELinux guide on RHEL 7.9 with SELinux enabled, you may encounter an error when running yum install yum-utils.
The command fails with a 404 - Not Found error for the HashiCorp repository.
Loaded plugins: langpacks, product-id, search-disabled-repos, versionlock, yum_rhui_plugin https://rpm.releases.hashicorp.com/RHEL/7Server/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found Trying other mirror.
This error prevents the installation from proceeding.
Prerequisites
- Terraform Enterprise Replicated installation on RHEL 7.9 or a similar RHEL 7 version.
Cause
The error occurs for two primary reasons:
- End of Maintenance: RHEL 7.9 has reached its End of Maintenance (EoM) phase. HashiCorp repositories do not provide packages for distributions that are past their end-of-life status.
-
Incorrect URL Variable: The
$releasevervariable in the HashiCorp repository configuration resolves to7Serverinstead of7. This creates an invalid URL,https://rpm.releases.hashicorp.com/RHEL/7Server/x86_64/stable, which does not exist on the repository server, resulting in a 404 error.
Solutions
Note: Red Hat Enterprise Linux 7.9 has reached its End of Maintenance (EoM) phase. We recommend upgrading to a supported operating system. If you must use RHEL 7.9, you can use the following workarounds to resolve the repository issue.
Solution 1: Update the Repository Base URL
This solution involves modifying the HashiCorp repository file to use a static, correct URL.
-
Add the HashiCorp repository if you have not already.
$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
-
Open the repository configuration file for editing.
$ sudo vi /etc/yum.repos.d/hashicorp.repo
-
Locate the
baseurlline and replace the$releasevervariable with the static value7.Before:
baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/x86_64/stable
After:
baseurl=https://rpm.releases.hashicorp.com/RHEL/7/x86_64/stable
- Save the file and exit the editor.
-
Clean the
yumcache.$ sudo yum clean all
-
Retry the installation.
$ sudo yum install yum-utils
Solution 2: Temporarily Disable the Repository
If the first solution does not work, you can temporarily disable the HashiCorp repository to install yum-utils from another configured repository.
-
Open the HashiCorp repository configuration file.
$ sudo vi /etc/yum.repos.d/hashicorp.repo
-
Locate the
enabledparameter and change its value from1to0.enabled=0
- Save the file and exit the editor.
-
Proceed with the installation from an alternative repository.
$ sudo yum install yum-utils
-
After the installation is complete, re-enable the HashiCorp repository by setting
enabledback to1in the/etc/yum.repos.d/hashicorp.repofile.enabled=1
- Save the changes and exit the editor.
Outcome
By applying one of these solutions, you can resolve the repository error and proceed with the Terraform Enterprise installation.