29
21

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 5 years have passed since last update.

Homebrewで「Warning: The following directories are not writable by your user:」とエラーが出た際の解消法

Last updated at Posted at 2019-07-02

Homebrewを使っている際、
アップデートやインストール問題のチェックを行うと出るエラーが出ることがあります。

1.環境

PC : mac
OS : macOS Mojava バージョン10.14.4
Homebrew : バージョン 2.1.6
このPCではanacondaを使用しています

2. エラーが出るコマンドの例

アップデート

brew update

インストール問題のチェック
brew doctor

3. エラーの出力部分

Warning: The following directories are not writable by your user:
/usr/local/lib/pkgconfig
/usr/local/share/info
/usr/local/share/man/man3
/usr/local/share/man/man5

You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/lib/pkgconfig /usr/local/share/info /usr/local/share/man/man3 /usr/local/share/man/man5

And make sure that your user has write permission.
chmod u+w /usr/local/lib/pkgconfig /usr/local/share/info /usr/local/share/man/man3 /usr/local/share/man/man5

4. 解決策

今回のエラーの場合

sudo chown -R $(whoami) /usr/local/lib/pkgconfig /usr/local/share/info /usr/local/share/man/man3 

正確には

sudo chown -R $(whoami) エラーのあるフォルダのパス

です。まあ、正直エラーのにどうすればこのエラーが解消されるか書いてありますね。。
これは、僕調べではフォルダのユーザー権限を変更するコマンド見たいです。

5. 参考文献

システムデザイン研究所 | Homebrewがupdateできないときの対処
Qiita | homebrewとは何者か。仕組みについて調べてみた

29
21
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
29
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?