Homebrew For Mac M1



19 Dec 2020

  1. Homebrew For Mac M1a
  2. Homebrew For Mac M1 Garand

After reading all the raving reviews online about the new Apple M1-based Mac computers, and after losing too much time with my overheating MacBook Pro 2013 that’s on its last legs, I caved and bought a Mac Mini M1.

The homebrew installation script will install the program to / usr / local / homebrew by default, which is the installation path on Intel chip architecture, while the M1 chip needs to be installed under / opt / homebrew /.

  1. Thanks for this. Got my dev environment back up well, the equivalent of it. I've been running stuff using vagrant and virtualbox. But virtualbox is not working. So I was able to recreate it using homebrew. Picked up the Mac mini M1 and it's been running great. Runs cool and fans have yet to spin. Can't say the same for my 2016 MBP i7. It works but hot and audible. – w1n78 Nov 18 '20 at 15:15.
  2. In this video, I'll show you how to install Homebrew on an Apple Silicon Mac. Homebrew currently doesn't officially support Apple Silicon, so you either have.
  3. I've seen three main ways that people are installing homebrew on their M1 Macs. The best method of install should be as smooth as possible while emulating intel architecture, and also should be as easy as possible to switch homebrew to native architecture when that is possible.

☑️ Apple 30″ Cinema display (2013)

I made the mistake of thinking that any USB hub with a Mini Displayport connector would work with my Cinema display. But apparently, not all such ports are also Thunderbolt 2, as I found out with my Satechi hub.. Fortunately, Apple sells a 55 euro Thunderbolt 3 (with USB-C connector) to Thunderbolt 2 (with mini Displayport connector), and it works perfectly. This already takes 1 of the 2 USB-C ports on the Mac Mini.

☑️ Homebrew in native mode

I do a lot of bash/script development so my first concern was getting all of my bash scripts working on the new ARM architecture. I concentrated on bash/terminal in native arm64 mode, which means not running under Rosetta2. This because I want to benchmark in native mode, and I kind of assume that under Rosetta 2 everything works that worked under MacOS for Intel, and where’s the fun in that?

Homebrew For Mac M1a

For that, I needed to get the Homebrew package manager running in native mode. The thing is, Homebrew does not yet support the new Apple Silicon M1 chip (they only started the first steps in Dec 2020), so you have to dodge all the warnings they throw at you. After someresearch, I found the best way to do it, and I combined all of it in an easy install/uninstall bash script:** https://github.com/pforret/m1_homebrew** It installs the command-line tools and Homebrew to /opt/homebrew for arm64 mode, and to /usr/local for standard i386 mode.

Running it is as easy as:

🤞 brew install –build-from-source

After installation, running brew install will give you warnings and will often not be able to install the packages, because there are no pre-built casks for Apple Silicon yet.

Still, you can tell brew to install from source code, and compile on your machine by using brew install --build-from-source (or shorter: brew install -s). For small packages like awk, this will do the job. For large packages with lots of dependencies like ffmpeg, brew will stop for lack of bottles.

☑️ native imagemagick

My first big package to install was imagemagick. It’s my go-to tool for image manipulation and part of many of my scripts like e.g. splashmark. Imagemagick has lots of brew dependencies for treating different kinds of files, like libpng, openjpeg, webp and ghostscript. Every time brew requires a package that isn’t installed yet, it stops with the error mentioned above. You then have to build that package separately and try the original brew install again. This is how I got imagemagick compiled in the end.

Homebrew

☑️ m1_homebrew recursive

I automated this process in the same script m1_homebrew.sh. m1_homebrew recursive imagemagick first looks for all the dependent packages (via brew info), installs those first one by one and then, at the end, installs the main package. It can take a long time but it’s magic when it works.

😥 no native ffmpeg

Unfortunately, it doesn’t always work. I tried it for ffmpeg, but this package requires some dependencies that will not build on MacOS M1 for now. Concretely: rust and openjdk cannot be built yet, and ffmpeg requires them.

  • rust: hangs on “arch -x86_64 make” which implies that it’s building a x86_64 (Intel) version instead of a arm64 native version,
  • openjdk: “configure: The tested number of bits in the target (64) differs from the number of bits expected to be found in the target (32)

They are both still marked as ⚠️ on the official Homebrew M1 compatibility list.

Recent Posts

Generate individual tag/category/author pages for your Jekyll website

I’ve been migrating more and more of my websites to Jekyll static sites, from Wordpress. The advantages are clear:

  • version management with git suits me (it’s... • 21 Mar 2021

My disaster upgrade to LastPass Premium

LastPass has started pushing its free users towards a paid premium subscription. The way they do this is by only allowing the free version for 1 platform, e.g. only your... • 18 Mar 2021

Detecting excessive SSD wear on Apple Silicon M1 machines

Some more professional users of the new M1 Macbooks are experiencing extremely high drive writes over relatively short time. The most severe cases have “consumed” about 10-13% of the... • 22 Feb 2021

Macbook

Homebrew For Mac M1 Garand

  • Install Homebrew


    Paste that in a macOS Terminal or Linux shell prompt.

    The script explains what it will do and then pauses before it does it. Read about other installation options.

  • What Does Homebrew Do?


    Homebrew installs the stuff you need that Apple (or your Linux system) didn’t.

  • Homebrew installs packages to their own directory and then symlinks their files into /usr/local.

  • Homebrew won’t install files outside its prefix and you can place a Homebrew installation wherever you like.

  • It’s all Git and Ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.

  • Homebrew complements macOS (or your Linux system). Install your RubyGems with gem and their dependencies with brew.

  • “To install, drag this icon…” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software.

  • Donate to Homebrew

  • Homebrew Blog

  • Analytics Data

  • Homebrew was created by Max Howell. Website by Rémi Prévost, Mike McQuaid and Danielle Lalonde.