Merge pull request #31348 from hashicorp/fix-apt-page

Update commands for new Ubuntu version
This commit is contained in:
Laura Pacilio 2022-06-30 17:58:09 -04:00 committed by GitHub
commit 0dfda6a6bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,33 +27,44 @@ package repositories.
## Repository Configuration ## Repository Configuration
The Terraform packages are signed using a private key controlled by HashiCorp, 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.
so in most situations the first step would be to configure your system to trust
that HashiCorp key for package authentication. For example: To configure your repository:
1. Download the signing key to a new keyring.
```bash ```bash
wget -qO - terraform.gpg https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/terraform-archive-keyring.gpg $ wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
1. Verify the key's fingerprint.
```bash
$ gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
```
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**.
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`.
```bash
$ echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list
``` ```
After registering the key, you can add the official HashiCorp repository to 1. Download the package information from HashiCorp.
your system:
```bash ```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/terraform-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/terraform.list $ sudo apt update
``` ```
The above command line uses the following sub-shell commands: 1. Install Terraform from the new repository.
* `dpkg --print-architecture` to determine your system's primary APT
architecture/ABI, such as `amd64`.
* `lsb_release -cs` to find the distribution release codename for your current
system, such as `buster`, `groovy`, or `sid`.
To install Terraform from the new repository:
```bash ```bash
sudo apt update $ sudo apt install terraform
sudo apt install terraform
``` ```
## Supported Architectures ## Supported Architectures