Skip to content

Instantly share code, notes, and snippets.

@Molin-L
Last active February 24, 2024 21:28
Show Gist options
  • Save Molin-L/3090d8d38f77a9a411d59f57e6a1537f to your computer and use it in GitHub Desktop.
Save Molin-L/3090d8d38f77a9a411d59f57e6a1537f to your computer and use it in GitHub Desktop.
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