Migrate from Intel (Rosetta2) to ARM brew on M1 #417
Replies: 10 comments 49 replies
-
The old installation stays there, allowing you to migrate it to the new
Unless you uninstall your Rosetta 2 installation, yes. Don't forget to add |
Beta Was this translation helpful? Give feedback.
-
By default on Big Sur (or possibly due to migrating from High Sierra via Time Machine), Is homebrew expecting a chown first? A bit of googling suggests there's no standard for who should own Relevance: the homebrew Alternative Installation instructions say to create a |
Beta Was this translation helpful? Give feedback.
-
This is what worked for me. If |
Beta Was this translation helpful? Give feedback.
-
What I did is running |
Beta Was this translation helpful? Give feedback.
-
@SaschaKo77 Thanks for this comment, super helpful. I just got my MBP 16" M1 Max today and running I've done: # write a file with all existing brew packages out to Brewfile
brew bundle dump
# re-install Homebrew, will install into /opt/homebrew and use the arm version
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Any idea what I should set in MacBook-Pro ➜ ~ which brew
/usr/local/bin/brew Also, after I migrate all my packages from the |
Beta Was this translation helpful? Give feedback.
-
I've successfully migrated all my brew packages into The Homebrew uninstall script will uninstall everything I want to keep in |
Beta Was this translation helpful? Give feedback.
-
Is there a recommended way to transfer over things installed by Homebrew formulas in |
Beta Was this translation helpful? Give feedback.
-
After using brew bundle dump, is there any reason to not remove the Intel version first, before installing the M1 version, to remove any ambiguity of what's being removed? |
Beta Was this translation helpful? Give feedback.
-
Thanks everyone for the tips. I went through and put this together for myself and my son to not spend the hour and a quarter doing this also. ## Migrating Homebrew from Intel to M1
## You can copy and paste into the Terminal
## Go to home directory
cd ;
## Create list of installed Intel packages
brew bundle dump ;
## Install new version of Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ;
## Update the PATH to point to M1 version first
eval "$(/opt/homebrew/bin/brew shellenv)" ;
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc ;
## Migrate Intel packages (/usr/local/bin/brew) to M1 (/opt/Homebrew)
## You may need to enter your sysadmin password
brew bundle --file Brewfile ;
## Update packages
brew update ;
## Upgrade packages
brew upgrade ;
## Clean up
brew cleanup ;
## Uninstall old Intel version
# Download uninstall script
curl -fsSL -o ./uninstall.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh ;
# Run the uninstall specifying the old path
sudo /bin/bash ./uninstall.sh --path=/usr/local ;
# Enter password
# Type Y to uninstall
# Delete uninstall script
rm uninstall.sh ;
# Final cleanup
brew cleanup ; |
Beta Was this translation helpful? Give feedback.
-
I had the homebrew version of $ lipo -info /usr/local/bin/bash
Non-fat file: /usr/local/bin/bash is architecture: x86_64 I've been using iTerm for my terminal, and despite the fact that I don't have iTerm set to $ $SHELL --version
GNU bash, version 5.0.0(1)-release (x86_64-apple-darwin16.7.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ uname -m
x86_64
$ uname -p
i386 Again, even if I were to use Apple's version of bash from $ /bin/bash -c "uname -p"
i386
$ /bin/bash -c "uname -m"
x86_64 So as-is, if I were to attempt an install of homebrew I'd be installing the x86_64 version of homebrew, and not the Apple Silicon version. So to ensure that the install would really give me the Apple Silicon version, I used the ## prove that Apple's version of bash is really a universal binary
$ lipo -info /bin/bash
Architectures in the fat file: /bin/bash are: x86_64 arm64e
## prove that the arch -arm64 will really run as Apple Silicon
$ arch -arm64 uname -m
arm64
$ arch -arm64 uname -p
arm
$ arch -arm64 /bin/bash -c "uname -m"
arm64
$ arch -arm64 /bin/bash -c "uname -p"
arm
## perform the actual install
$ arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I noticed the progress on Homebrew/brew#10152 and that the installation script has been updated to install under the new
/opt/homebrew
prefix on M1 Macs. I had brew installed through Rosetta2 (/usr/local/homebrew
) and runningbrew up && brew doctor
now tells me:What is the best way to move from Rosetta2 to ARM on M1 Macs? Should I follow uninstall instructions + new installation?
Running
brew upgrade
displays:But it's not clear what happens to the old installation... Does it get removed, do we need to handle 2
brew
commands?Beta Was this translation helpful? Give feedback.
All reactions