Terraform Challenge 1 bug?

When trying to running basic update commands to install terraform it is giving an error. Attached screenshot. Nothing mentioned regarding this in solution as well[1], hence I guess this is not part of the challenge. Can you please look into it and confirm?

[1] terraform-challenges/challenge-1 at master · kodekloudhub/terraform-challenges · GitHub

I’m not sure what’s going on. Your output suggests that you have not added the hashicorp apt repos.

Problem is, I have done that, and I still can’t install terraform – I get the error

Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease                                               
Err:5 https://apt.releases.hashicorp.com bionic Release                 
  404  Not Found [IP: 18.154.185.57 443]
Hit:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease         
Hit:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done                     
E: The repository 'https://apt.releases.hashicorp.com bionic 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.

which is unexpected; it appears there’s some transient problem with their repos. I’d tell you to try to download binaries from their releases page, but 1.15 is so old they only have source code; you’d need to build terraform 1.1.5 from scratch, which is likely not what the intention is.

Try waiting a few hours and trying the install link to see if the situation has healed. If it hasn’t righted itself in a few hours, I’ll look into this again.

Seems there is already an open issue

I tried the steps mentioned in

Still same issue

Actually not the issue you’re facing. Yes, those are obsolete repositories. But they don’t interfere with installing terraform. You’re not installing K8s; you don’t need a valid K8s repo for not installing it. You should be able to install terraform by:

  • adding the Hashicorp repository to APT
  • apt update
  • apt install terraform

I have doubts if it is possible to install v1.1.5 even under those circumstances, but right now, you can’t install anything newer either. Because apparently, there’s a problem with Hashicorp’s repo right now as well.

Or easier than that

{
apt update
apt install unzip -y
curl -L -o /tmp/terraform_1.1.5_linux_amd64.zip https://releases.hashicorp.com/terraform/1.1.5/terraform_1.1.5_linux_amd64.zip
unzip -d /usr/local/bin /tmp/terraform_1.1.5_linux_amd64.zip
}
root@controlplane ~ ✖ terraform version
Terraform v1.1.5
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.9.0. You can update by downloading from https://www.terraform.io/downloads.html

Except I don’t think that a binary is available for 1.1.5 any more. I checked releases; all they have for 1.1.5 is source archives. You’d need to install make and a mess of other stuff, and golang to build it with.