LoginSignup
12
11

More than 5 years have passed since last update.

brew updateをしたらError: /usr/local must be writable!が出た

Posted at

はじめに

Homebrewのアップデートのためにターミナルからbrew updateを実行するとError: /usr/local must be writable!というエラーが出ました。

解決策

sudo chgrp -R admin /usr/local
/usr/local ディレクトリと中身のグループをグループ名adminに再帰的に変更します。

sudo chmod -R g+w /usr/local

/usr/localディレクトリのアクセス権限を変更します。ディレクトリとその中身のアクセス権限を再帰的に変更するために-Rオプションをつけます。グループの権限として書き込み権を与えます。

確認方法

brew doctor
を実行してYour system is ready to brew.になれば正常終了です。

おまけ

私が初めに実行したときには、"You may wish to brew unlink these brews:
readline"という警告が出ました。

そこで、brew unlink readlineした後で、brew install readlineを実行しました。brew doctorYour system is ready to brew.が無事表示されるようになりました。

参考文献

Homebrew の update が失敗する問題
【chgrp】Linuxでファイルやディレクトリのグループを変更するコマンド
【Mac】Homebrewアップデート時のコマンド一式

12
11
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
12
11