Search code examples
installationhomebrewminikubeapple-m1

Homebrew installs wrong minikube (amd64) instead of 'arm64' on m1 Mac


Homebrew (brew install minikube) is installing amd64 'minikube' on Macbook Air with M1. while running any minikube command, it prints following message:

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                          │
│    You are trying to run the amd64 binary on an M1 system.                                               │
│    Please consider running the darwin/arm64 binary instead.                                              │
│    Download at https://github.com/kubernetes/minikube/releases/download/v1.25.2/minikube-darwin-arm64    │
│                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯
minikube version: v1.25.2

I think when I installed Homebrew, it wasn't ported to M1, but later I upgraded it, uninstalled and re-installed it, but still same problem.

Any Idea how can I install correct version with Homebrew?

I know, I can install specific arm64 version with sudo install, but I prefer to manage packages with Homebrew.


Solution

  • Found the issue and posting solution here for someone who might get the same issue. Rare, but could happen... :-)

    The problem was that the Terminal application was running under Rosetta. The Homebrew installation script runs command /usr/bin/uname -m to check system architecture. Running this command in a Terminal which runs in Rosetta, returns amd64 architecture, hence homebrew assumes it to be Intel Mac.

    To remove Terminal from running under Rosetta, Go To: Finder -> Applications -> Utilities -> Terminal. Right click on Terminal and select Get Info. Uncheck checkbox: 'Open in Rosetta'. Quit Terminal Application.

    Restart Terminal Application and test with command /usr/bin/uname -m. It should print arm64

    Note: before doing all this, remove Homebrew and all its files/folders.