How to update Homebrew after using Migration Assistant to go from an Intel-based Mac to M1.
- Remove
/usr/local/binfrom yourPATH(e.g.echo $PATHthenexport PATH=...without/usr/local/binin it)
- This was tricky because
/usr/local/binhad been added to the path from multiple locations and by multiple processes (also had to check~/.z*for e.g..zprofileand.zenv)
wget https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh(https://github.com/Homebrew/install#uninstall-homebrew)brew bundle dumpto get a list of installed packageschmod +x uninstall.sh && sudo ./uninstall.sh --path=/usr/localrm -rf /usr/local/Caskroom && rm -rf /usr/local/Cellar(if the script didn't do it)brew bundle install --file Brewfileto reinstall old packages