LoginSignup
185

More than 3 years have passed since last update.

Mac M1(Apple Silicon)でhomebrewをインストールできるの?

Last updated at Posted at 2020-11-18

今まで通りにインストールしようとしたら...

現状、ターミナルから今まで通り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

今まで通りではダメみたいですね。

対策1 ターミナルをRossetaを使用して開くようにする

  • ターミナルの情報を開きます。

image.png

Rosettaを使用して開くにチェック

そうすることでhomebrewのインストールが可能になります。

$ brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: You are using macOS 11.0.
We do not provide support for this released but not yet supported version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
released but not yet supported version.

対策2 /opt/homebrewに保存するように実行する

https://docs.brew.sh/Installation では

However do yourself a favour and install to /usr/local on macOS Intel, /opt/homebrew on macOS ARM, and /home/linuxbrew/.linuxbrew on Linux.

とあります。
macOS ARMでは/opt/homebrewにインストールしてねと案内されています。

実行コマンド

cd /opt
mkdir homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

まとめ

せっかくのARMなので極力Rosetta使用したくないですよね。
いずれはuniversalに移行するのに...

状況に応じてインストールしましょう!

追記

homebrewがApple Siliconに対応したバージョンを発表しました。
Apple Siliconの場合は/opt/homebrewに自動でインストールしてくれるみたいです。
※ homebrewでインストールできるパッケージが全部Apple Siliconに対応したわけではありません。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
185