Install Homebrew on M1 Macbook

Dhananja Kariyawasam
2 min readJan 6, 2021

--

Homebrew is a handy package manager for MacOS as well as for the Linux. When it comes to MacOS, by default it’s missing. So you need to install it manually on your Mac.

When it comes to Apple Intel Chip, Installing Homebrew in Intel-based Macs is straightforward and your need run below command in your terminal,

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

But if you running above command on the Apple Silicon M1 chip MacBook Air or Pro, you will get below error,

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Homebrew is not (yet) supported on ARM processors!
Rerun the Homebrew installer under Rosetta 2.
If you really know what you are doing and are prepared for a very broken experience you can use another installation option for installing on ARM:
https://docs.brew.sh/Installation

So, After struggling couple of hours, I found couple of ways to install the Homebrew on Apple Silicon M1 chip.

1 . Run the Homebrew installer under Rosetta 2

If you to know more about Rosetta 2, click here to read more about the Rosetta 2 and here I’ll about the Rosetta. Basically, Rosetta is a translation process that allows users to run apps that contain x86_64 instructions on Apple silicon. Rosetta was introduced when Apple’s hardware transitioned from Power-PC-based to Intel-based CPUs.

Usually It doesn’t come with macOS Big Sur. So you need to install it manually. To install Rosetta, run below command in your terminal.

softwareupdate --install-rosetta

Once you complete the Rosetta installation, run below command to install the Homebrew.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

After the installation is completed, you can update the packages with Homebrew. always make sure to use arch -x86_64 before the command.

arch -x86_64 brew update

2 . Run Terminal using Rosetta

This is the easiest ways to install home brew, First go to Application > Utilities and right click on Terminal and click Get Info and tick Open using Rosetta.

Add alt text

Now your can run install command without mentioning the architecture.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Extra

On that link below you can confirm what are packages that are optimized for Apple Silicon so far.

https://isapplesiliconready.com/app/Homebrew

--

--