-
Install Homebrew natively on Apple Silicon (will install to
/opt/homebrewby default):/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install Intel-emulated Homebrew (will install to
/usr/localby default):arch --x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"If you haven’t yet installed Rosetta 2, you’ll need to run
softwareupdate --install-rosettafirst. -
Create an alias for Intel homebrew. I’m calling mine
browbecause O for old. But hey you do your own thing.In
~/.zshrc(or your shell’s equivalent) add:alias brow='arch --x86_64 /usr/local/Homebrew/bin/brew' -
Add ARM Homebrew to your PATH.
In
~/.zshrc(or your shell’s equivalent) add:# Homebrew on Apple Silicon path=('/opt/homebrew/bin' $path) export PATHIf you’re still on
bashit’d bePATH=/opt/homebrew/bin:$PATH -
Confirm
which brewshould return/opt/homebrew/bin/brewbrew --prefixshould return/opt/homebrewwhich browshould returnbrow: aliased to arch --x86_64 /usr/local/Homebrew/bin/brewbrow --prefixshould return/usr/local
If you have the same command installed in both Homebrews, it’ll default to Apple Silicon (/opt/homebrew/) since we prepended that one in our PATH. To override, run the command with its full path (/usr/local/bin/youtube-dl), or override your PATH for one command (PATH=/usr/local/bin youtube-dl).
I also created another handy alias in .zshrc (alias ib='PATH=/usr/local/bin') so I can prepend any Homebrew-installed command with ib to force using the Intel version of that command:
~ ▶ which youtube-dl
/opt/homebrew/bin/youtube-dl
~ ▶ ib which youtube-dl
/usr/local/bin/youtube-dl
If you prefer Intel to be the default brew, add /opt/homebrew/bin to the end of your PATH instead of the beginning.