Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)
Solution 1
For what it's worth, before installing Homebrew you will need to install Rosetta2 emulator for the new ARM silicon (M1 chip). I just installed Rosetta2 via terminal using:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
This will install rosetta2 with no extra button clicks.
After installing Rosetta2 above you can then use the Homebrew cmd and install Homebrew for ARM M1 chip: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Once Homebrew for M1 ARM is installed use this Homebrew command to install packages: arch -x86_64 brew install <package>
Solution 2
Homebrew needs to be installed in two places on Apple silicon: in /usr/local for rosetta-emulated (Intel) code, and /opt/homebrew for ARM64. These are somewhat hard-coded and the /opt/homebrew one MUST be used for ARM code, as it stands today, and is non-negotiable. However, it's easy enough to install and you can follow the general instructions on the official docs. You open a Rosetta shell first.
% arch -x86_64 zsh
% cd /usr/local && mkdir homebrew
% curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Later, to install tools under intel you can use the arch command per-command or open a zsh terminal as above.
arch -x86_64 /usr/local/homebrew/bin/brew install sometool
For the ARM architecture, you don't need to use arch
but you do need to use the full path of the homebrew command.
/opt/homebrew/bin/brew install sometool
You could rename the brew commands to something like brew86 and brewARM to help keep them separate.
Solution 3
Just use:
arch -arm64 brew install package-name
replace 'package-name' with the package you want to install.
Solution 4
Did a temporary fix by enabling Open using Rosetta
option in the terminal app from Utilities
folder.
However, it would be great to know the actual solution for this question to use the native way.
Solution 5
This issue with new macbook pro M1 chip
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
For Resolve follow below steps
Step1
$ brew bundle dump
Step2
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step3 Edit file below
$ vi ~/.bashrc or vi ~/.zshrc
Edit below line in above file
export PATH=/opt/homebrew/bin:$PATH

Prashanth Sams
Author of Selenium Essentials O'Reilly | PacktPub | Amazon.in | Amazon.com | Amazon (Kindle) | Google | Barnes&Noble | Apple Store Selenium WebDriver, Appium, API, Locust, Cucumber, Docker, Helm, Kubernetes, Jenkins, Jenkins job-dsl, AWS, Git, Github, Gitlab, Ruby, Python, JavaScript, TypeScript, Groovy, Shell, Protractor, Java, Grafana, Prometheus, Datadog, Graphite, CasperJS, Behave, JBehave Blog: http://www.seleniumworks.com/ https://devopsqa.wordpress.com/ Skype: prashanth.sams Official Site: http://prashanthsams.com Twitter: https://twitter.com/prashanthsams GitHub: https://github.com/prashanth-sams LinkedIn: https://www.linkedin.com/in/prashanth-sams-58208953/ Google+: https://plus.google.com/u/0/104394276212961437513/posts Facebook: https://www.facebook.com/groups/selenimusers/
Updated on February 10, 2022Comments
-
Prashanth Sams over 2 years
I use the latest
Apple M1
chip processor. And I keep getting errors while application installation.say.,
brew install openjdk@11
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)! Please create a new installation in /opt/homebrew using one of the "Alternative Installs" from: https://docs.brew.sh/Installation You can migrate your previously installed formula list with: brew bundle dump
Need help with exact steps to follow.
-
indojin over 3 years"You could rename the brew commands to something like brew86 and brewARM to help keep them separate" - How exactly to do this?
-
SamJakob over 3 years@indojin You can use a ZSH alias. By adding
alias brew86="arch -x86_64 /usr/local/homebrew/bin/brew"
andalias brewARM="/opt/homebrew/bin/brew"
to your~/.zshrc
file -
Martin over 3 yearsI also used the alias. I wonder why this is not standard for the homebrew installation... ;)
-
Martin over 3 yearsProblem with this is that in the end you will eventually need to use both homebrew versions. The answer should at least point out the consequences of this change... ;)
-
Maniprakash Chinnasamy about 3 yearsI have already installed HomeBrew in this path /opt/homebrew/ and installed Nginx and PHP too which is working properly. Does this break if I execute the above command?
-
Ty Conway about 3 yearsHow do you know if want to install something to 86 or ARM?
-
Omar Shabab about 3 yearsAfter this command :
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
I getInstalling Rosetta 2 on this system is not supported.
-
manoj patel about 3 yearsmy answer based on M1 chips and my experience
-
PARITOSH THAPLIYAL about 3 yearsThanks. The approved answer did not work for me for some reason. But after I ran the commands including CURL. I have been able to install the package.
-
Vikas Sharma about 3 yearsI am also facing the same issue is there any other workaround for this
Installing Rosetta 2 on this system is not supported.
-
dwaz almost 3 yearsThis works and doesn't require brew to be installed twice.
-
Duc Nguyen almost 3 yearsUncheck run with rosetta in terminal and it can be install Rosetta 2. It works for me
-
Hung Vu almost 3 yearsi unchecked rosetta in terminal, but it still get that error @DucNguyen
-
user3305074 almost 3 yearsQuit terminal and then try again.
-
benomatis over 2 yearsI'm wondering what the difference is between this solution and the one @court3nay provided - there 2 instances of brew is installed, one using rosetta, another one for ARM - this one here only uses rosetta, so will I be missing out on anything if I use this option only?
-
rahul over 2 yearsAdd an alias
alias brew86="arch -x86_64 /usr/local/homebrew/bin/brew"
to your.zshrc
for future convenience -
jmealy over 2 yearsSeconding @Martin's note above. Regardless of your experiences, it'd be good to make folks aware.
-
rsaha77 over 2 yearsFor those getting the response: "Permission denied @ rb_file_s_symlink", try: $ sudo chown -R $(whoami) $(brew --prefix)/*
-
RandomDeveloper over 2 yearshey, thanks for this btw. After adding your 3rd command to install my package, which in this case is rgdbs - rgbds.gbdev.io/install/macos - getting the following error:
/usr/local/Cellar/libpng/1.6.37 is not a valid keg
Any ideas? -
Gnardog about 2 yearsI had the error
Installing Rosetta 2 on this system is not supported.
, and solved it by doing the following: 1. I had previously set up my terminal to 'run with Rosetta', so I decided to duplicate it and rename the new application 'Rosetta-Terminal' (optional, but good if you need rosetta for other things) 2. Unchecked 'run with rosetta' in 'get info' of 'Terminal'. 3. Quit and Reopen Terminal... ran the command and it worked -
sday about 2 yearsThis was the simple answer for my 2021 M1 Max running on Monterey 12.1. If new to nginx, read the output of the install. You do need to start the service and by default it's listening on port 8080 on version 1.21.6_1 of nginx.
-
Abana Clara about 2 yearsAfter running this I was able to run
brew install php
with no problems -
Dashiell Rose Bark-Huss about 2 yearsdidn't work for me to upgrade node
-
Dashiell Rose Bark-Huss about 2 yearsThis works but it's missing some steps. After you run the first command make sure you run the two commands brew asks you to run. And after running
brew bundle dump
move the BrewFile created bybrew bundle dump
intoopt/homebrew
. From that directory, runbrew bundle install
.brew bundle dump
doesn't install the packages, it just creates a BrewFile that tells brew what packages it should install when you runbrew bundle install
. Like a package.json file in node.js. -
Ram Fattah about 2 years@Gnardog thank you so much, this indeed worked from my end as well!
-
Pin almost 2 yearsAn additional note to Dashiell's comment: make sure you run
brew bundle dump
with/usr/local/Homebrew/bin/brew
or otherwise you'll be executing the newly installedbrew
, which won't have access to the old packages.