Mac M1 Upgrade

Homebrew

Posted by Greg Stephens on December 05, 2021 · 1 min read

Re-installing Homebrew and it’s packages when upgrading to the M1

Start by re-running the Homebrew install script which will give you the M1 homebrew in /opt/homebrew/bin. You’ll still have the old Install binary at /usr/local/bin/brew.

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

I ran into a git error and have to remove /usr/local/bin/git.

Update the .zshrc file with an alias to the Intel brew and add the new path:

alias oldbrew=/usr/local/bin/brew

Update Packages

First, look at the Intel packages you have installed

oldbrew list

Use a simple script to upgradepkg.sh:

#!/bin/bash
brew install $1
if [ $? -eq 0 ]
then
  echo Removing old $1
  /usr/local/bin/brew uninstall $1
fi

Remove packages with no remaining dependencies:

oldbrew autoremove