Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joseph-ravenwolfe/de8de3c0f79c4684eb4505c2d072d133 to your computer and use it in GitHub Desktop.
Save joseph-ravenwolfe/de8de3c0f79c4684eb4505c2d072d133 to your computer and use it in GitHub Desktop.
Install Go on Apple Silicon ARM M1

Install Go (v1.16beta) on Apple Silicon, use with Homebrew

Go is not available to install via Homebrew at the time of this writing. (Dec 18th 2020)

Go v1.16 will ship with Apple Silicon support in February of 2021, however the Go 1.16 beta can be installed from the Go website and can be linked to brew so that other brew packages that depend on Go may use it.

  1. Install go1.16beta1.darwin-arm64.pkg.
  2. Run mkdir /opt/homebrew/Cellar/go
  3. Create a symlink to the Go v1.16 pkg installation with ln -s /usr/local/go /opt/homebrew/Cellar/go/1.16
  4. Run brew link go
  5. Ensure /opt/homebrew/bin is listed ahead of /usr/local/bin in your $PATH
  6. Open a new shell and test by running go version which should report go1.16beta1 darwin/arm64
  7. Running which go should show that it is coming from Homebrew as /opt/homebrew/bin/go

Installing packages from Homebrew that depend on Go will require checking the dependencies of the package using brew info <package_name> and installing each of the dependencies (except for Go) manually by running brew install <dependency_name>.

After installing all non-Go dependencies, we should be able to run brew install <package_name> --ignore-dependencies to install the package while using the ARM version of Go linked from Homebrew.

Example

# Attempt to install Direnv which relies on Go
> brew info direnv
...
==> Dependencies
Build: go ✘
> brew install direnv --ignore-dependencies
🍺  /opt/homebrew/Cellar/direnv/2.25.2: 10 files, 8.4MB, built in 4 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment