Skip to content

Commit 0dfda6a

Browse files
authored
Merge pull request hashicorp#31348 from hashicorp/fix-apt-page
Update commands for new Ubuntu version
2 parents acb79a7 + d0bb372 commit 0dfda6a

1 file changed

Lines changed: 32 additions & 21 deletions

File tree

‎website/docs/cli/install/apt.mdx‎

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,45 @@ package repositories.
2727

2828
## Repository Configuration
2929

30-
The Terraform packages are signed using a private key controlled by HashiCorp,
31-
so in most situations the first step would be to configure your system to trust
32-
that HashiCorp key for package authentication. For example:
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.
3331

34-
```bash
35-
wget -qO - terraform.gpg https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/terraform-archive-keyring.gpg
36-
```
32+
To configure your repository:
3733

38-
After registering the key, you can add the official HashiCorp repository to
39-
your system:
34+
1. Download the signing key to a new keyring.
4035

41-
```bash
42-
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
43-
```
36+
```bash
37+
$ wget -O- https://apt.releases.hashicorp.com/gpg | \
38+
gpg --dearmor | \
39+
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
4440

45-
The above command line uses the following sub-shell commands:
41+
1. Verify the key's fingerprint.
4642
47-
* `dpkg --print-architecture` to determine your system's primary APT
48-
architecture/ABI, such as `amd64`.
49-
* `lsb_release -cs` to find the distribution release codename for your current
50-
system, such as `buster`, `groovy`, or `sid`.
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**.
5149
52-
To install Terraform from the new repository:
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`.
5351
54-
```bash
55-
sudo apt update
56-
sudo apt install terraform
57-
```
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+
```
5869
5970
## Supported Architectures
6071

0 commit comments

Comments
 (0)