The Startup
Published in

The Startup

Issues Installing Homebrew on New Macbook M1 Silicon? Here’s How to Fix It.

Having trouble setting up your environment and Homebrew on your new M1 MacBook Pro? If you’re one of the early adopters who got the new M1 Apple Silicon Mac just to find that Homebrew and many other native terminal apps don’t yet have support for the new ARM architecture, you’ll be happy to know there’s a fairly simple workaround.

If your terminal messages look anything like this…

Error messages in terminal

Or …

That means it’s time to put this simple workaround into action.

Let’s Begin

First, it’s important to note that when dealing with Homebrew or most other apps for that matter- you can for the most part get away with successful commands simply by prefacing them with arch -x86_64 in your terminal.

arch -x86_64

Remembering to preface each terminal command with arch -x86_64 can get annoyingly repetitive very quickly. Luckily there’s a better way.

The Easy Way:

This included installing something called Rosetta 2. What is Rosetta 2? It’s a translation layer in macOS Big Sur runs apps compiled for the Intel chipset. Rosetta 2 enables a Mac with Apple silicon to use apps built for a Mac with an Intel processor. Previously macs ran on Intel chips before they set out to create their own chips for higher performance. Given that Intel applications aren’t equipped to run natively on Apple Silicon, the Rosetta 2 emulator will be critical.

So let’s go ahead and install this translater to run in the background with ALL our terminal commands without having to think about it. (Hint: it includes running Rosseta on an entirely new terminal).

Step 1

Create a copy of your terminal app. Go to Applications > Utilities. Then double click on the terminal folder and hit duplicate.

Next, go ahead and right-click on your new terminal copy and hit rename. Rename this new terminal app to Terminal x86. You can rename this to anything you want, but the point is to make it recognizable from the original terminal app.

Step 2

Let’s set the new terminal as the default to run Rosseta 2 in the background with all your terminal commands.

Right-click on your new Terminal x86 app and select Get Info.

Check the box to Open using Rosetta. Now, this terminal will open with Rosetta every time.

Don’t see this checkbox? You may need to install Rosetta 2 first. Run this code in your native terminal. You can learn more about installing Rosetta here or see the Apple Docs.

/usr/sbin/softwareupdate — install-rosetta

Step 3

You’re all set! You can install Homebrew and run all apps just as you’ve done before. It’s like nothing ever happened (except for the M1 performance upgrade!)

Go ahead and add it to its new home on your dock. This way you make sure you open the right terminal every time. Let’s pretend the original terminal never existed (for now).

Terminal x86 with Rosetta on Mac Dock

What Can’t Be Translated With Rosetta?

Rosetta can translate most Intel-based apps, including apps that contain just-in-time (JIT) compilers. However, Rosetta doesn’t translate the following executables:

  • Kernel extensions
  • Virtual Machine apps that virtualize x86_64 computer platforms

Rosetta translates all x86_64 instructions, but it doesn’t support the execution of some newer instruction sets and processor features, such as AVX, AVX2, and AVX512 vector instructions. If you include these newer instructions in your code, execute them only after verifying that they are available.

You can read more about limitations here.

This solution works until Homebrew is updated to support ARM and apple silicon natively.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin Botero

Kevin Botero

26 Followers

I get techy on here. { firstName: “Kevin”, lastName: “Botero”, interests: [“tech”, “startups”] }