How To Install Homebrew on Apple Silcon (M1) with Big Sur
Homebrew will not be ported to the ARM architecture anytime soon, as work on ARM has been running for many years (see the timeline here). But a lot of Formulae have alread been shown to work with the Rosetta 2 emulation on the M1 processors from Apple.
But how can I install homebrew on Apple Silicion? The command for installing homebrew is:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
So let’s start a terminal window on Apple Silicon an and running this bash command … unfortunately you will get the following error message(s):
Homebrew is not (yet) supported on ARM processors!Rerun the Homebrew installer under Rosetta 2.
In my particularly case I want to install postgres, which is a formula already categorized to work fine on Apple Silicon M1, but how can install homebrew with Apple Rosetta2?
The easy way
You can simply tell the bash which architecture to chose with the prefix:
arch -x86_64 /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
But for those not familiar with the bash and who want to make more changes in the terminal, or even enforcing any other app to use the Intel pat in the universal binary, the following approach might be helpful.
Running a special flavor (Intel emulation, or ARM code) in a universal binary
If you have a universal binary on your macOS, running Apple Silicon (M1), Apple Terminal or the fantastic freeware replacement iTerm2 is straightforward.
You can decide which part of a universal binary will start, and whatever will run in this app will be executed under this “architecture”. This means that if you are starting a terminal with Rosetta2, all the typed in commands will be emulated with Rosetta too as well.
Go to Finder and chose the terminal.app
with a right-click select “Get Info”
Rosetta will most likely not be activated. By changing this setting the terminal.app will run in future under the Rosetta2 emulation.
When running now the above bash-command homebrew will run successfully. After the installation you can install formulae which are known to run fine on Apple Silicon (M1). In my case for instance postgres.
brew install postgres
Once you are finished with the commands you want to run in this app under the emulation please take care to switch off the Rosetta2 emulation.
Sign in or become a blog.xojoDOCs.com member to join the conversation.
Just enter your email below to get a log in link.