If you have used Homebrew to try and install a particular package onto an Apple Silicon Mac and you see an error message stating “The arm64 architecture is required for this software” that prevents the installation of the package, you might be surprised by this error message given that you’re using an Apple Silicon Mac (any M1, M2, M3, M4, etc machine).
It turns out that some Apple Silicon Mac users who installed Homebrew in the past may have either inadvertently set the x86 version as the default, or even installed the x86 version (Intel) of Homebrew instead of the arm64 version (Apple Silicon), which then leads to the “arm64 architecture is required for this software” error message when attempting to install a package intended for an ARM Mac.
Fortunately this is pretty easy to fix with a few command line tweaks, so if you see the “The arm64 architecture is required for this software” message with Homebrew, read along and it’ll be resolved in no time.
How to fix the brew “arm64 architecture required” Error on Apple Silicon Macs
Open the Terminal if you haven’t done so already on the Mac throwing the brew error, and perform the following.
First, switch to the arm64 Apple Silicon version of HomeBrew with the following command:
eval "$(/opt/homebrew/bin/brew shellenv)"
This command configures your shell environment to recognize Homebrew at the path used by the ARM64 (Apple Silicon) version of Homebrew (/opt/homebrew/bin/brew), which is different from the x86 path for Homebrew (/usr/local/bin/brew).
Next, we use the arm64 version of Homebrew to install the package in question that was originally throwing the error message, with the following command:
arch -arm64 brew install asitop
In this example we’re installing asitop, which requires Apple Silicon architecture to make full use of the powermetrics command. The ‘arch -arm64’ command specifies the architecture for using the command which in this case is ARM64 for Apple Silicon processors (including M1, M2, M3, M4, etc etc).
After using the aforementioned commands, asitop for arm64 installs and launches as intended:
Using the arch command as a prefix isn’t always necessary, but in this case we’re using it to make sure the command runs in ARM64 mode rather than x86 mode with Rosetta 2.
Do I need to uninstall and reinstall Homebrew for ARM64?
No, in most cases you can simply switch Homebrew to run the arm64 version in your PATH at /opt/homebrew/bin/brew with the aforementioned command.
The x86 Intel version of Homebrew is located in a separate location at /usr/local/bin/brew
If you need to for whatever reason, you can switch back and forth between the two by simply using the following commands from earlier:
Use the arm64 version of Homebrew:
eval "$(/opt/homebrew/bin/brew shellenv)"
Use the x86 version of Homebrew:
eval "$(/usr/local/bin/brew shellenv)"
Typically this isn’t necessary for most Homebrew users, but in some situations when using the Game Porting Toolkit, wineskin, etc, or even certain packages, some Mac users may need to switch back and forth.
–
Have you ever ran into this error message before with Homebrew, and did the solution outlined above resolve it for you too? Let us know your own experiences with ARM64 Homebrew in the comments.