Skip to content

Instantly share code, notes, and snippets.

@miketahani
Last active December 6, 2022 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketahani/746047578c1cd60764352d5ec3724c7a to your computer and use it in GitHub Desktop.
Save miketahani/746047578c1cd60764352d5ec3724c7a to your computer and use it in GitHub Desktop.

How to update Homebrew after using Migration Assistant to go from an Intel-based Mac to M1.

  1. Remove /usr/local/bin from your PATH (e.g. echo $PATH then export PATH=... without /usr/local/bin in it)
  • This was tricky because /usr/local/bin had been added to the path from multiple locations and by multiple processes (also had to check ~/.z* for e.g. .zprofile and .zenv)
  1. wget https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh (https://github.com/Homebrew/install#uninstall-homebrew)
  2. brew bundle dump to get a list of installed packages
  3. chmod +x uninstall.sh && sudo ./uninstall.sh --path=/usr/local
  4. rm -rf /usr/local/Caskroom && rm -rf /usr/local/Cellar (if the script didn't do it)
  5. brew bundle install --file Brewfile to reinstall old packages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment