Skip to content

Instantly share code, notes, and snippets.

@jamesmurdza
Last active April 11, 2022 22:57
Show Gist options
  • Save jamesmurdza/6500c256353fb2bbd4046e1c4c0488dc to your computer and use it in GitHub Desktop.
Save jamesmurdza/6500c256353fb2bbd4046e1c4c0488dc to your computer and use it in GitHub Desktop.
Setup dual-architecture Homebrew on a M1 Mac.
# Setup dual-architecture Homebrew on a M1 Mac.
# 1. Install Rosetta (if necessary):
softwareupdate --install-rosetta
# 2. Install Homebrew for M1:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 2. Install Homebrew for Rosetta:
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 3. Alias brew_x86 to the ARM version of Rosetta.
echo 'alias brew_x86="arch -x86_64 /usr/local/bin/brew"' >> ~/.zshrc
# 4. Verify that everything worked:
which brew # Should be: /opt/homebrew/bin/brew
brew --prefix # Should be: /opt/homebrew
which brew_x86 # Should be: arch -x86_64 /usr/local/bin/brew
brew_x86 --prefix # Should be: /usr/local
# Uninstall Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" # Uninstall Rosetta brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)" # Uninstall M1 brew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment