Skip to content

Instantly share code, notes, and snippets.

@Chinmay1743
Last active June 12, 2023 09:16
Show Gist options
  • Save Chinmay1743/068944d6df2a444540bd8ed20e9ce578 to your computer and use it in GitHub Desktop.
Save Chinmay1743/068944d6df2a444540bd8ed20e9ce578 to your computer and use it in GitHub Desktop.
Official HashiCorp documentation gave a few errors so instead follow these steps:

Go to : https://developer.hashicorp.com/terraform/downloads

Follow instructions for Ubuntu/Debian except you need to hardcode the $(lsb_release -cs) part as given for debian and other distributions.

The given commands work:


sudo apt install gpg

wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg

Check if it is correct :

gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint

Then do :

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com bookworm main" | sudo tee /etc/apt/sources.list.d/hashicorp.list

Notice the word bookworm

List of words for hardcoding can be found on : https://www.hashicorp.com/official-packaging-guide

The original solution was posted here : https://discuss.hashicorp.com/t/apt-install-terraform-fails-as-per-docs/29690/5

The instructions to install terraform mentioned above were taken from : https://stackoverflow.com/a/75254686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment