[Solved] Terraform will damage your computer on Mac

Suddenly, if you have started getting the error “terraform will damage your computer. You should move it to the Trash“, then you are also in the same boat as many other Terraform users, developers, sysadmins, etc.

terraform will damage your computer

Cause of Terraform will damage your computer

First of all, don’t panic, and don’t move your Terraform to trash.

The main cause of this error is changing of the GPG key that was scheduled on “4/24/2023” for Linux users.

As per the announcement from Hashicorp, they have changed the gpg key of their binary in response to CircleCI’s January 3, 2023 security alert.

Solution for Terraform will damage your computer for Mac Intel User

If you are Apple Mac Intel user, you just need to remove the Terraform software from your machine and then install it again.

brew unintall <terraform-version>
brew install <terraform-version>

This will fix the issue as it will have a new GPG key.

Solution for Terraform will damage your computer for Mac M1 User

If you have Mac M1 or M2 machine having an arm64 processor, you have to follow the same procedure as above and remove the Terraform from your Apple Mac machine.

If you manage, Terraform through the “tfenv” utility, you can simply follow the below procedure. This method is tested and you don’t have to remove tfenv itself.

Here are the commands and sample output:

tfenv uninstall <Terraform-version>
TFENV_ARCH=amd64 tfenv install <Terraform-version>
tfenv use <Terraform-version>

Output:


tfenv uninstall 1.3.7
Uninstall Terraform v1.3.7
Terraform v1.3.7 is successfully uninstalled

tfenv uninstall 1.3.7
TFENV_ARCH=amd64 tfenv install 1.3.7
tfenv use 1.3.7

If you will not use “TFENV_ARCH=amd64” variable in front of the install command, you will get the below error:

tfenv install 1.3.7
Installing Terraform v1.3.7
Downloading release tarball from https://releases.hashicorp.com/terraform/1.3.7/terraform_1.3.7_darwin_arm64.zip
curl: (22) The requested URL returned error: 404                                                                                      

Tarball download failed

Hope you have found this article useful. If you do, please share it with your colleagues, and don’t forget to subscribe to our free newsletter.

If you are facing any issues, please comment below.

Buy me a coffeeBuy me a coffee

Add Comment

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