Problems installing Terraform on Kali Linux

Hi,

I follow the steps to install Terraform on my Linux here: Install Terraform | Terraform - HashiCorp Learn

But the last command: sudo apt-get update && sudo apt-get install terraform
Gives this:

Ign:1 https://apt.releases.hashicorp.com kali-rolling InRelease
Err:2 https://apt.releases.hashicorp.com kali-rolling Release
404 Not Found [IP: 151.101.86.49 443]
Reading package lists… Done
E: The repository ‘https://apt.releases.hashicorp.com kali-rolling Release’ does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Anyone know how I can fix it?

You may want to check this old post:

Also, since Terraform itself is just a single executable file, you can just download a binary that supports your distribution, and using a package manager is optional:

Hi @rogern,

Kali Linux is not one of the distributions supported by our APT repository, so this is unfortunately a correct error.

If Kali Linux is sufficiently similar to one of the supported distributions then you may be able to change the distribution name in sources.list file or sources.list.d/* file to select one of those instead of kali-rolling instead, but I’m not familiar enough with Kali Linux to say whether that is true and, if so, which of the supported distributions would be most suitable to choose.

As @shohei noted, you can also directly download the main .zip release archives and extract them to get a terraform executable. The APT packages for Terraform on apt.releases.hashicorp.com just wrap that same executable with APT metadata, and so an executable installed in that way should behave identically to one installed using APT.

1 Like

I came across this article for same issue, installing terraform on Kali Linux WSL. I added below ubuntu package repo in in /etc/apt/sources.list.d/hashicorp.list.

deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com kinetic main

And installation worked without any issue.
sudo apt update && sudo apt install terraform

1 Like

Thank you this worked for me