Homebrew Apple M1
- I tried to install homebrew in a new mac with M1 chip. When I do brew -version, I got this: brew -version Homebrew 3.1.2-40-g520b811 Homebrew/homebrew-core N/A Anyone knows how to fix it Homebrew/.
- Apple says that the M1 MacBook Pro/Air can run one external display with up to 6K resolution at 60Hz. For me, I was using the CharJen Pro hub to connect two Dell 2K monitors on my late-2019 MBP. But now the MacBook Air only supports one external monitor, either via the USB4 directly or the HDMI port at the CharJen Pro hub.
- I recently purchased a MacBook Pro 13' with the M1 chip and transferred all my data over using a Time Machine backup. Homebrew packages are currently installed in /usr/local/opt/ but it is my understanding that they should be under /opt/homebrew for Apple Silicon Macs. How can I: Get the list of packages I currently have installed.
- How to install Homebrew on macOS Catalina or M1 Mac Open Terminal and enter this command xcode-select -install Click Install from the popup. Go through the T&C and click Agree if you do.
Let the great Homebrew migration begin. Yes, Homebrew now has native support for Apple’s ARM64-based M1 chip. The latest version, 3.0.0, released 5 February, will run nicely on your Apple Silicon Mac. There’s a catch, of course. Well, several catches: first, not all of the tools you can install using Homebrew are M1 native yet and, second, Homebrew doesn’t offer explicit migration instructions, that I could find at least.
So I leapt in and hoped for the best. I’ve been using a mix of native Terminal (for tool usage) and Terminal under Rosetta 2 (for tool installation and upgrades), so anything that saves me from maintaining two Termini or temporarily switching the Open using Rosetta option in the utility’s Get Info panel (and usually forgetting to switch it back afterwards) is a bonus. Here’s what I did.
Homebrew, one of the most popular package managers for macOS, has been updated with support for Apple Silicon M1 Macs. Work had been going on for some time to convert most bottles for packages to.
First, re-run the Homebrew installer. On an M1 Mac it will create a new installation under /opt/homebrew
(on Intel it’s under /usr/local/bin
).
If you’ve been using Homebrew under emulation, you now have two side-by-side installs, so from this point on it’s a matter of working tool by tool, installing an ARM64 versions then removing the x86-64 version. Tools that lack ARM64 versions can stay in the emulated world — just move on to the next one.
Edit your .bash_profile
or .zshrc
file to update any PATH
additions or aliases to the new Homebrew installation. For example, alias nano=/opt/homebrew/nano
instead of alias nano=/usr/local/bin
and export PATH='/opt/homebrew/bin:$PATH'
in place of export PATH='/usr/local/bin:$PATH'
. But do read on for a solution that works with multiple Macs of different CPU architectures.
I didn’t do this at this point, but were I to do all this again, I would add a further alias: alias oldbrew=/usr/local/bin/brew
just to make accessing the old install a little more convenient.
I had side-by-side terminal tabs, one for brew …
and the other for /usr/local/bin/brew …
as I worked through my installed tools to check they install natively in the first tab and, if so, uninstalling the non-native version from the second tab.

I found that the majority of my previously installed tools have ARM64 versions, including some, like the Go language, which did not when I last checked, a few weeks ago. I can now build my websites with Hugo running on Go natively. Python 3.9 is M1 native, so that saves a lot of bother; I was able to rip out the non-native version entirely. Your mileage will vary according to which tools you use.
For example, I use shellcheck for linting Bash scripts, but it’s not yet native and, as the Homebrew folk warn might be the case, can’t be built from source, at least not using Homebrew. Fortunately, I don’t use shellcheck regularly, so I can afford to wait for native support among all of its many dependencies. It still runs, of course, under Rosetta. I just need to try to re-install it using the native Homebrew every so often, or keep tabs on the Homebrew GitHub repo.
Once you’ve done, it’s worth running brew cleanup
to clear out any cruft from each install and then manually deleting any remaining orphaned files and links from /usr/local
— look in the various sub-directories, including Caskroom
, Cellar
, Frameworks
, Homebrew
, and lib
. If all of your Homebrew-installed tools are now native, you may not want to keep the old Homebrew install, and so the first four of these can probably be deleted.
Take care with the contents of /usr/local/bin
— you may have tools there that were not installed by Homebrew, or were installed by Homebrew but with fixed install locations. For instance, my command line tools imageprep, pdfmaker and utitool continue to install into /usr/local/bin
even when installed by M1-native Homebrew and even though they contain native ARM64 code.
Multiple Homebrews on multiple Macs

If, like me, you have multiple Macs with different CPU architectures, you can add something like this to your .bash_profile
or .zshrc
file:
See Also
Instead of boring you with the background history that I was starting to write, I realized it can all be summarized to these 3 points:
Utility Homebrew Apple Silicon M1 Support
- Most blog posts you might have read before this one are outdated or contain incorrect information and bad advice.
- Homebrew works natively on M1 Macs now (for all common tools needed for Ruby development), so you don't need to use Rosetta. If you made any changes to your shell file so that it runs commands using
arch -x86_64
, you can undo them. Similarly, if you are prepending all your commands witharch -x86_64
, you don't need to do that anymore. - The easiest way to set up a complete Ruby web development environment on an M1 Mac is to use my free script.
Homebrew installs things in a different directory when in native mode (/opt/homebrew
) versus /usr/local
in Rosetta mode (or when using the arch -x86_64
flag). So, it's easy to get confused and run into issues if you launched Terminal in native mode but started running some commands with arch -x86_64
and others without. Or if you launched Terminal in Rosetta mode and then tried to work with things that expected native mode.
When you use my script, you don't have to worry about any of this.
Homebrew M1 Mac
Although it can detect which mode you're in and install Homebrew and other tools in the appropriate places, I recommend doing everything in native mode since it's fully supported now. I've been using Jekyll and Rails without any issues on my M1 MacBook Air. My script also automatically installs Jekyll and Rails for you.
Homebrew Apple M1

One issue you might run into if you have an existing Ruby project with an older version of the ffi
gem, is an error saying failed to load command
and then a more specific error like this one:
The solution is simple:
For Rails and Jekyll projects, you might need to update both ffi
and sassc
:
If you see other unexpected errors that point to a particular gem, the first thing I would try is to update that gem.
