Problem
When installing Terraform Enterprise (TFE) Replicated using this article , on RHEL 7.9 with SELinux enabled, customers may encounter an issue while running yum install yum-utils
. The error message observed is:
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 and is related to a repository configuration issue.
Prerequisites
Installing TFE replicated on RHEL7.9
Note - You may face similar issue in other RHEL7 versions as well
Cause
1 -: RHEL 7.9 has reached its End of Maintenance (EoM) phase. You can find more details about it [here].The HashiCorp repository does not provide packages for distributions that have reached their end-of-life status.
2-: The issue occurs because the $releasever
variable in the base URL for the HashiCorp repository does not resolve correctly in certain RHEL 7.9 environments. The variable $releasever
translates to 7Server
instead of 7
, leading to an invalid URL.
For example, the repository URL is set to:
https://rpm.releases.hashicorp.com/RHEL/7Server/x86_64/stable
This URL results in a 404 error because 7Server
is not a valid directory on the repository server.
Possible Solution
Note: RHEL 7.9 has reached its End of Maintenance (EoM) phase, and it is not recommended to continue using this operating system. However, if its use is necessary for specific cases, the following workaround can be applied to address the issue.
Solution 1: Static Base URL Update
After running the command:sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
A repository file is created under /etc/yum.repos.d/
. Inside this file, in the baseurl
field for the HashiCorp repository, you need to replace the variable $releasever
with the static value 7
. This ensures that the packages resolve correctly.
-
Open the repository configuration file:
sudo vi /etc/yum.repos.d/hashicorp.repo
-
Locate the
baseurl
line. It will look similar to:baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/x86_64/stable
-
Replace
$releasever
with7
to create a static URL. The updated line should be:baseurl=https://rpm.releases.hashicorp.com/RHEL/7/x86_64/stable
-
Save the file and exit the editor.
- Run the command "yum clean all"
-
Retry the installation:
sudo yum install yum-utils
This ensures that the repository URL resolves correctly.
Solution 2: Temporarily Disable the Repository (Only if solution 1 is not working )
-
Open the HashiCorp repository configuration file:
sudo vi /etc/yum.repos.d/hashicorp.repo
-
Locate the
enabled
parameter and change its value from1
to0
to disable the repository:enabled=0
-
Save the file and exit the editor.
-
Proceed with the required installation using an alternative or already-configured repository:
yum install yum-utils
-
Once the installation is complete, re-enable the HashiCorp repository by setting the
enabled
parameter back to1
:enabled=1
-
Save the changes and exit the editor.
Outcome
By following the recommended solution outlined above, you should be able to successfully install TFE Replicated. However, if the issue persists, please open a support ticket with HashiCorp for further assistance.