Yum repository doesn't have packages for CentOS Stream 9

I’m trying to install terraform on CentOS Stream 9 but I get an error:

[sergeyr@localhost ~]$ sudo yum -y install terraform
Hashicorp Stable - x86_64 1.1 kB/s | 311 B 00:00
Errors during downloading metadata for repository ‘hashicorp’:

Please tell how to install Terraform on this CentOS or how to install previous version? Thanks in advance!
Meanwhile I’ll try to install a Linux binary file…

Hi @sergey!

Our documentation has a list of the supported distribution releases, which at the time of writing doesn’t include RHEL 9, which I assume correlates with CentOS 9.

I’m not personally familiar enough with Yum to give instructions on how to force it to use a different version, but I do know that the .rpm files in these repositories are all just wrappers around the same Linux executable available on releases.hashicorp.com, and so a hypothetical package built for RHEL 9 would contain exactly the same executable as the one for RHEL 8, and so it should work to install the RHEL 8 package on CentOS 9.

When I retrieve the documented installation URL https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo I see the following content, at the time of writing:

[hashicorp]
name=Hashicorp Stable - $basearch
baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://rpm.releases.hashicorp.com/gpg

[hashicorp-test]
name=Hashicorp Test - $basearch
baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://rpm.releases.hashicorp.com/gpg

Perhaps it work to retrieve this metadata file, replace the $releasever placeholder with a hard-coded 8 to force using the older version, and then add the result to Yum. However, I cannot promise that will work, since I am not familiar with Yum and have not tested it.

I’m getting the same problem with RHEL 8.6:

sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum install terraform -y
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Hashicorp Stable - x86_64                                                               1.1 kB/s | 313  B     00:00
Errors during downloading metadata for repository 'hashicorp':
  - Status code: 404 for https://rpm.releases.hashicorp.com/RHEL/8.6/x86_64/stable/repodata/repomd.xml (IP: 13.224.132.102)
Error: Failed to download metadata for repo 'hashicorp': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
1 Like

I getting the same problem with RHEL 8.4 or 8.6.

The repository server is expecting the release version to be exactly 8. I don’t see any separate indices there for individual minor releases, but as I mentioned above the package contents for Terraform are identical across all of these anyway, so if you use the packages for release version 8 then I’d expect them to work on any reasonable version of RHEL/CentOS/etc.

The supported URL is: https://rpm.releases.hashicorp.com/RHEL/8/x86_64/stable/repodata/repomd.xml

1 Like