Skip to content

Install Terraform in Ubuntu/Debian

In this post let’s discuss how to install Terraform in Ubuntu / Debian operating systems. HashiCorp is the company who develops and maintains Terraform packages. We can install Terraform using popular package managers after adding Hashicorp’s key and repository for Terraform.

Advertisements

Add the HashiCorp GPG Key

> curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
[sudo] password for anand: 
OK

Add the HashiCorp Linux repository.

>sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu focal InRelease                                                                                                                                                  
Get:3 https://apt.releases.hashicorp.com focal InRelease [4,419 B]                                                                                                                                         
Hit:4 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                                                                 
Hit:5 http://ppa.launchpad.net/ubuntuhandbook1/gimp/ubuntu focal InRelease                             
Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]        
Get:7 https://apt.releases.hashicorp.com focal/main amd64 Packages [11.7 kB]                
Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.3 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [55.7 kB]
Hit:10 http://archive.ubuntu.com/ubuntu focal InRelease                       
Get:11 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [209 kB]                                                                                                                  
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [200 kB]                                                                                                              
Fetched 723 kB in 10s (72.7 kB/s)                                                                                                                                                                          
Reading package lists... Done

Update apt-get and install terraform

> sudo apt-get update && sudo apt-get install terraform
Advertisements
The following NEW packages will be installed:
  terraform
0 upgraded, 1 newly installed, 0 to remove and 61 not upgraded.
Need to get 34.9 MB of archives.
After this operation, 85.5 MB of additional disk space will be used.
Get:1 https://apt.releases.hashicorp.com focal/main amd64 terraform amd64 0.13.4 [34.9 MB]
Fetched 34.9 MB in 5min 25s (107 kB/s)                                                                                                                                                                     
Selecting previously unselected package terraform.
(Reading database ... 249652 files and directories currently installed.)
Preparing to unpack .../terraform_0.13.4_amd64.deb ...
Unpacking terraform (0.13.4) ...
Setting up terraform (0.13.4) ...

Validate installation

> terraform -v
Terraform v0.13.4

Fin.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.