How to install tfswitch on Ubuntu 20.04

How to install tfswitch on Ubuntu 20.04

Overview:

The tfswitch command line tool lets you switch between different versions of terraform. If you do not have a particular version of terraform installed, tfswitch lets you download the version you desire.

Installation:

  1. Download the latest current version 0.13.1218 from here
  2. Extract tfswitch into /usr/local/bin. This directory is used for locally installed software.
    sudo mv tfswitch /usr/local/bin
    
  3. Check version:
    tfswitch --version
    

Usage:

Usage of the tool is simple. You just need to run the tfswitch command and select the required version of Terraform

tfswitch

Reference:

  1. Terraform Switcher
  2. Introduction to tfswitch
  3. What is /usr/local/bin?