Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Homebrew on Apple silicon device/M1.
# Install ARM Homebrew to /opt/homebrew
# 安装ARM版本的Homebrew 到 /opt/homebrew
mkdir /opt/homebrew
sudo chown -R $(whoami) /opt/homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C /opt/homebrew
# Install x86 Homebrew
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Set alias for different homebrew
echo "alias abrew=\"/opt/homebrew/bin/brew\"" >> ~/.zshrc # ARM Homebrew
echo "alias ibrew=\"arch -x86_64 /usr/local/bin/brew\"" >> ~/.zshrc # X86 Homebrew
echo "export PATH=\"/opt/homebrew/bin:$PATH\"" >> ~/.zshrc
echo "Try \'abrew\' to run ARM Homebrew, and \'ibrew\' to run x86 Homebrew"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment