github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/cli/install/apt.html.md (about)

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