Installing Terraform on Linux using the APT package manager
In the previous recipe, we learned how to install Terraform on Linux using a script. In this recipe, we will install Terraform on Linux using the Advanced Package Tool (APT) package manager, which is a common native package manager.
Note that in this recipe we will install Terraform on Ubuntu/Debian. To learn how to install Terraform on other Linux distributions, read the documentation here https://www.hashicorp.com/official-packaging-guide.
Getting ready
For this recipe, we need to have a Linux workstation and a terminal console.
How to do itβ¦
To install Terraform on Linux using the package manager, execute the following script in the terminal console:
sudo apt update && sudo apt install gpg
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp...