Last active
February 24, 2024 21:28
-
-
Save Molin-L/3090d8d38f77a9a411d59f57e6a1537f to your computer and use it in GitHub Desktop.
Install Homebrew on Apple silicon device/M1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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