Workaround for Homebrew: “terraform@0.12 has been disabled because it is not supported upstream!”

I needed to install an older version of Terraform on my work Mac, but got this error:

Error: terraform@0.12 has been disabled because it is not supported upstream!

I tried to edit terraform@0.12 and tried to install without success. This is what worked:

HOMEBREW_NO_INSTALL_FROM_API=1 brew install terraform@0.12


?  Source brew install terraform@0.12
Error: terraform@0.12 has been disabled because it is not supported upstream!
?  Source HOMEBREW_NO_INSTALL_FROM_API=1 brew install terraform@0.12
==> Fetching terraform@0.12
==> Downloading https://ghcr.io/v2/homebrew/core/terraform/0.12/manifests/0.12.31
####################################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/terraform/0.12/blobs/sha256:21aa5de3857889453b4ec7ed810df350b22838cda61baa7e6db6a0c3946d5891
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:21aa5de3857889453b4ec7ed810df350b22838cda61baa7e6db6a0c3946d5891?se=2023-05-16T20%3A55%3A00Z&sig=Cdb%2F%2FXmhPJNspNN6FdcDiFLysIMJiYZvKxCH
####################################################################################################################################################################################################################### 100.0%
==> Pouring terraform@0.12--0.12.31.monterey.bottle.tar.gz
==> Caveats
terraform@0.12 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have terraform@0.12 first in your PATH, run:
echo ‘export PATH=”/usr/local/opt/terraform@0.12/bin:$PATH”‘ >> ~/.zshrc
==> Summary
? /usr/local/Cellar/terraform@0.12/0.12.31: 6 files, 42.7MB
==> Running `brew cleanup terraform@0.12`…
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
? Source terraform version
Terraform v0.12.31

Your version of Terraform is out of date! The latest version
is 1.4.6. You can update by downloading from https://www.terraform.io/downloads.html

Maven error in OS X: “Maven already installed, it’s just not linked”

If you use Homebrew on OS X and you come across the error below, just:

  1. $ rm -rf /usr/local/Cellar/maven
  2. $ brew install maven
  3. $ mvn -version
  4. That’s it!

$ brew install maven
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (caskroom/cask, caskroom/versions).

Warning: maven-3.5.0 already installed, it's just not linked.