How to install terraform on Ubuntu:
samshaik@shaikprod:~$ sudo apt-get install terraform
[sudo] password for samshaik:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package terraform
Add the terraform provider's key:
samshaik@shaikprod:~$ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
OK
Add the terraform provider's repo on your debian/Ubuntu repos:
samshaik@shaikprod:~$ sudo apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
Get:1 https://apt.releases.hashicorp.com bionic InRelease [4421 B]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:3 https://packages.microsoft.com/repos/azure-cli bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:6 https://apt.releases.hashicorp.com bionic/main amd64 Packages [22.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1696 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2039 kB]
Get:10 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1124 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1733 kB]
Fetched 6871 kB in 13s (523 kB/s)
Reading package lists... Done
Now install the package:
samshaik@shaikprod:~$ sudo apt-get install terraformReading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
terraform
0 upgraded, 1 newly installed, 0 to remove and 183 not upgraded.
Need to get 32.6 MB of archives.
After this operation, 79.6 MB of additional disk space will be used.
Get:1 https://apt.releases.hashicorp.com bionic/main amd64 terraform amd64 0.15.0 [32.6 MB]
Fetched 32.6 MB in 2s (15.0 MB/s)
Selecting previously unselected package terraform.
(Reading database ... 78062 files and directories currently installed.)
Preparing to unpack .../terraform_0.15.0_amd64.deb ...
Unpacking terraform (0.15.0) ...
Setting up terraform (0.15.0) ...
Verify the version:
samshaik@shaikprod:~$ terraform -v
Terraform v0.15.0
on linux_amd64