How to run the Homebrew installer under Rosetta 2 on M1 Macbook

流过昼夜 提交于 2020-11-30 04:58:37

问题


I'm on the M1 MacBook. This is the error when I try to install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Homebrew is not (yet) supported on ARM processors!
Rerun the Homebrew installer under Rosetta 2.
If you really know what you are doing and are prepared for a very broken experience you can use another installation option for installing on ARM:
  https://docs.brew.sh/Installation

So how do I "Rerun the Homebrew installer under Rosetta 2."?


回答1:


Got an answer from a developer in the Homebrew github https://github.com/Homebrew/brew/issues/9173

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Use this to install packages:

arch -x86_64 brew install <package>

If you have not yet installed Rosetta 2 to emulate Intel CPUs on ARM Macs, you will get the error arch: posix_spawnp: /bin/bash: Bad CPU type in executable. Prompt a Rosetta 2 installation with:

softwareupdate --install-rosetta



回答2:


I found a better solution IMO. You can run Terminal with Rosetta by going into your applications in Finder, select Terminal and press cmd(⌘)+I and check the "Open using Rosetta" option.

Sorry if the formatting is off, first time posting a solution.




回答3:


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 provided in this thread.




回答4:


arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" worked on my new M1 Mac



来源:https://stackoverflow.com/questions/64882584/how-to-run-the-homebrew-installer-under-rosetta-2-on-m1-macbook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!