Before install Homebew, make sure your macOS meets the install requirements.
Install Homebrew on macOS 11 (Apple Silicon)
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
When downloaded, it will detect your macOS architecture and if it’s Intel, Homebrew will be installed on
/opt/homebrew if macOS is Apple Silicon. Our macOS 11 is Apple Silicon (M1), hence Homebrew will be located at
Install another copy of Homebrew for Intel simulated terminal
For macOS 11 ARM (Apple Silicon), it’s best practice to install a 2nd copy of Homebrew dedicated to running programs that are not yet natively compiled for ARM. The second Homebrew must be installed on
/usr/local as recommended from the Alternative Installs option - Untar anywhere, or things would break when install by
$ cd /usr/local
$ mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Using ARM Homebrew and Rosetta Homebrew together
Now when you type
brew on the terminal, the native ARM Homebrew is running
$ which brew
$ brew --version
Homebrew/homebrew-core (git revision 7c34424687; last commit 2021-06-10)
Homebrew/homebrew-cask (git revision ab9a64f927; last commit 2021-06-10)
~/.zshrc and put this alias
alias ibrew='arch -x86_64 /usr/local/bin/brew'
Whenever you need to install a package under Rosetta, just use
ibrew install ...