2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

M1チップ搭載MAC(Apple Silicon)でhomebrewをインストールする方法(2021/01/16現在)

Last updated at Posted at 2021-01-16

0.背景

m1チップ搭載のmacbookを購入し、今までの手順でhomebrewをインストールしてもうまくいきませんでした。
(brew not foundの文字が...)
どうやらm1チップではインストール方法が違うそうです。
2通りあるので紹介します。

※Xcodeインストール済み

1.Rosetta2でのインストール

1.finderを開木、ターミナル上で右クリック。「情報を見る」を開きます
スクリーンショット 2021-01-16 22.39.38.png

2.「Rosettaを使用して開く」にチェックを入れます
スクリーンショット 2021-01-16 22.40.10.png

3.ターミナルを起動します
4.今までの手順でインストールできます
※今までの手順
下記をターミナルで実行

//raw.githubusercontent.com/Homebrew/install/master/install.sh)"

これで終了です。

2.ARM依存のインストール

1.上記と同じ方法で「情報を見る」を開き、「Rosettaを使用して開く」のチェックを外します。
2.ターミナルを起動し、下記コマンドを入力します

cd ~

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

sudo mv homebrew /opt/homebrew

cd /opt/homebrew/bin

./brew update

3..zshrcを編集し、パスを記述します
 3-1.下記コマンドを実行
 vim ~/.zshrc
 3-2.「i」を押下し、編集モードに
 3-3.export PATH="/opt/homebrew/bin:$PATH"を追記
 3-4.escキーと:wqで保存&編集終了!

4.下記コマンドでパスを通します
source .zshrc

これで終了です。
※/opt/homebrew配下にインストールされています。

最後に

思っていたよりも簡単にできました。
しかし、どちらがいいかと言われると.........
なんとも言えません。

個人的にはARM依存の方がパーフォーマンスもいいみたいなのでそちらを使う予定です。
ただhomebrewに紐づいているアプリケーションはうまく動くのか....
環境設定周りをいじらなければいけない気が...
と思っております。

以上!!

2
2
0

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?