How to install "tfenv" Terraform version manager on Ubuntu OS

Hey, I'm a postgraduate in Cyber Security with practical experience in Software Engineering and DevOps Operations. The top player on TryHackMe platform, multilingual speaker (Kazakh, Russian, English, Spanish, and Turkish), curios person, bookworm, geek, sports lover, and just a good guy to speak with!
Overview:
tfenv - is an open-source Terraform version manager tool. With this tool, you can easily install any required version of Terraform on your system and switch to other versions if needed.
Tested:
Ubuntu 20.04
Installation:
- Clone source files into
~/.tfenv:git clone https://github.com/tfutils/tfenv.git ~/.tfenv - Add
~/.tfenv/binto your$PATH:echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bash_profile - Create symlink to the executable:
sudo ln -s ~/.tfenv/bin/* /usr/local/bin
Usage:
- To get installed version:
tfenv --version - To get list of all available commands:
tfenv - To list all installed versions:
tfenv list - To list all installable versions from remote repositories:
tfenv list-remote - To install a specific version of Terraform use:
tfenv install [version] - To uninstall a specific version use:
tfenv uninstall [version] - To switch to a specific version use:
tfenv use [version] - To write the current active version to
./.terraform-versionuse:tfenv pin
Uninstall:
- Delete entry from
~/.bash_profilefile:grep -v 'export PATH="$HOME/.tfenv/bin:$PATH"' ~/.bash_profile > ~/.bash_profile_tmp && mv ~/.bash_profile_tmp ~/.bash_profile - Unlink symlink:
sudo unlink /usr/local/bin/tfenv - Delete
~/.tfenvfolder:rm -rf ~/.tfenv/





