github.com/eliastor/durgaform@v0.0.0-20220816172711-d0ab2d17673e/website/docs/cli/install/apt.mdx (about) 1 --- 2 page_title: APT Packages for Debian and Ubuntu 3 description: >- 4 The HashiCorp APT repositories contain distribution-specific Terraform 5 packages for both Debian and Ubuntu systems. 6 --- 7 8 # APT Packages for Debian and Ubuntu 9 10 The primary distribution packages for Terraform are `.zip` archives containing 11 single executable files that you can extract anywhere on your system. However, 12 for easier integration with configuration management tools and other systematic 13 system configuration strategies, we also offer package repositories for 14 Debian and Ubuntu systems, which allow you to install Terraform using the 15 `apt install` command or any other APT frontend. 16 17 If you are instead using Red Hat Enterprise Linux, CentOS, or Fedora, you 18 might prefer to [install Terraform from our Yum repositories](/cli/install/yum). 19 20 -> **Note:** The APT repositories discussed on this page are generic HashiCorp 21 repositories that contain packages for a variety of different HashiCorp 22 products, rather than just Terraform. Adding these repositories to your 23 system will, by default, therefore make several other non-Terraform 24 packages available for installation. That might then mask some packages that 25 are available for some HashiCorp products in the main Debian and Ubuntu 26 package repositories. 27 28 ## Repository Configuration 29 30 The Terraform packages are signed using a private key controlled by HashiCorp, so you must configure your system to trust that HashiCorp key for package authentication. 31 32 To configure your repository: 33 34 1. Download the signing key to a new keyring. 35 36 ```bash 37 $ wget -O- https://apt.releases.hashicorp.com/gpg | \ 38 gpg --dearmor | \ 39 sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg 40 41 1. Verify the key's fingerprint. 42 43 ```bash 44 $ gpg --no-default-keyring \ 45 --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \ 46 --fingerprint 47 ``` 48 The fingerprint must match `E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B`. You can also verify the key on [Security at HashiCorp](https://www.hashicorp.com/security) under **Linux Package Checksum Verification**. 49 50 1. Add the official HashiCorp repository to your system. The `lsb_release -cs` command finds the distribution release codename for your current system, such as `buster`, `groovy`, or `sid`. 51 52 ```bash 53 $ echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ 54 https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \ 55 sudo tee /etc/apt/sources.list.d/hashicorp.list 56 ``` 57 58 1. Download the package information from HashiCorp. 59 60 ```bash 61 $ sudo apt update 62 ``` 63 64 1. Install Terraform from the new repository. 65 66 ```bash 67 $ sudo apt install terraform 68 ``` 69 70 ## Supported Architectures 71 72 The HashiCorp APT server currently has packages only for the `amd64` 73 architecture, which is also sometimes known as `x86_64`. 74 75 There are no official packages available for other architectures, such as 76 `arm64`. If you wish to use Terraform on a non-`amd64` system, 77 [download a normal release `.zip` file](/downloads) instead. 78 79 ## Supported Debian and Ubuntu Releases 80 81 The HashiCorp APT server currently contains release repositories for the 82 following distribution releases: 83 84 * Debian 8 (`jessie`) 85 * Debian 9 (`stretch`) 86 * Debian 10 (`buster`) 87 * Debian 11 (`bullseye`) 88 * Ubuntu 16.04 (`xenial`) 89 * Ubuntu 18.04 (`bionic`) 90 * Ubuntu 19.10 (`eoam`) 91 * Ubuntu 20.04 (`focal`) 92 * Ubuntu 20.10 (`groovy`) 93 * Ubuntu 21.04 (`hirsute`) 94 * Ubuntu 21.10 (`impish`) 95 96 No repositories are available for other Debian or Ubuntu versions or 97 any other APT-based Linux distributions. If you add the repository using 98 the above commands on other systems then `apt update` will report the 99 repository index as missing. 100 101 Terraform executables are statically linked and so they depend only on the 102 Linux system call interface, not on any system libraries. Because of that, 103 you may be able to use one of the above release codenames when adding a 104 repository to your system, even if that codename doesn't match your current 105 distribution release. 106 107 Over time we will change the set of supported distributions, including both 108 adding support for new releases and ceasing to publish new Terraform versions 109 under older releases. 110 111 ## Choosing Terraform Versions 112 113 The HashiCorp APT repositories contain multiple versions of Terraform, but 114 because the packages are all named `terraform` it is impossible to install 115 more than one version at a time, and `apt install` will default to selecting 116 the latest version. 117 118 It's often necessary to match your Terraform version with what a particular 119 configuration is currently expecting. You can use the following command to 120 see which versions are currently available in the repository index: 121 122 ```bash 123 apt policy terraform 124 ``` 125 126 There may be multiple package releases for a particular Terraform version if 127 we need to publish an updated package for any reason. In that case, the 128 subsequent releases will have an additional suffix, like `0.13.4-2`. In these 129 cases, the Terraform executable inside the package should be unchanged, but its 130 metadata and other contents may be different. 131 132 You can select a specific version to install by including it in the 133 `apt install` command line, as follows: 134 135 ```bash 136 sudo apt install terraform=0.14.0 137 ``` 138 139 If your workflow requires using multiple versions of Terraform at the same 140 time, for example when working through a gradual upgrade where not all 141 of your configurations are upgraded yet, we recommend that you use the 142 official release `.zip` files instead of the APT packages, so you can install 143 multiple versions at once and then select which to use for each command you 144 run.