Home > front end >  How to move tf binary to another location?
How to move tf binary to another location?

Time:01-18

I installed an older version of terraform and the binary is in my downloads, how do I move it to another location? have to /opt/homebrew/Cellar/tfenv/3.0.0/versions/1.0.0/terraform

I used the method here: https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli

but I get: terraform is not a directory

CodePudding user response:

think about using tfenv if you want to maintain different terraform versions in same PC.

CodePudding user response:

By your path, it seems that you are using homebrew as a package manager.

Use these steps to install any version of terraform.

brew install tfenv
  • List the available versions of terraform via tfenv (optional)
## To view all the available versions via tfenv.
 tfenv list-remote 

## tfenv list-remote | head -n <number_of_last_terraform_versions_you_want_to_list>
 tfenv list-remote | head -n 20 ## example 
  • To Install the required terraform version via tfenv
## tfenv install <terraform_version_you_want>
tfenv install 1.3.7
  • Switch to the version you installed via tfenv in the past or the last step.
## tfenv use <terraform_version_you_want>
tfenv use 1.3.7
  • Related