LoginSignup
26
14

More than 5 years have passed since last update.

Mac Os をSierraにしたらHomebrewがupdateできなくなった?

Posted at

HomebrewをUpdateしてみる

OsをSierraにしたので、このタイミングでbrewをupdateしようと思ったのですが、
少し手こずったので共有したいと思う。

$ brew update
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
sudo chown -R $(whoami) /usr/local

早速エラーメッセージが出てしまい、上手くいきませんでした。
でもここに答えはあった。

sudoで対応を試みる

$ sudo brew update
Password:
Error: Running Homebrew as root is extremely dangerous. As Homebrew does not
drop privileges on installation you are giving all build scripts full access
to your system. As a result of the OS X sandbox not handling the root user
correctly HOMEBREW_NO_SANDBOX has been set so the sandbox will not be used. If
we have not merged a pull request to add privilege dropping by November 1st
2016 running Homebrew as root will be disabled. No Homebrew maintainers plan
to work on this functionality.
Error: Cowardly refusing to 'sudo brew update'
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.

sudoは素人では下手したら困り果てる、
ということは教えて頂いたことはあるが、エラーメッセージからsudoは危険という警告を受け、
とりあえず立ち止まった。

エラーメッセージを見つめ直す

最初の
$ brew update
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
sudo chown -R $(whoami) /usr/local

ここで答えはあった。

そう、sudo chown -R $(whoami) /usr/local

これでupdateできる。

エラーメッセージは友達だね。

参考にしたサイト

26
14
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
26
14