How To Install Homebrew on Apple Silcon (M1) with Big Sur

How To Install Homebrew on Apple Silcon (M1) with Big Sur

Homebrew will not get 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 already 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:

So let’s start a terminal window on Apple Silicon 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 particular 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 choose with the prefix:
arch -x86_64

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 enforce any other app to use the Intel pat in the universal binary, the following approach might be helpful.

Running a special flavour (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.

Did you find this article valuable?

Support Jeannot Muller by becoming a sponsor. Any amount is appreciated!