2016-10-23 25 views
1

だから私は、端末のnoobのビットは、そう私と一緒にクマが、私は何かをインストールするために醸造を更新しようとしていたので、私は走っ:brew updateError: /usr/local must be writable!sudo:有効なuidが0ではない、sudoがsetuid rootにインストールされていますか? (MAC OS上でのx 10.12)

は実際にはなかったですこのことができますが、実行中ls -l $(which sudo)が私を与えた場合にはsudo: effective uid is not 0, is sudo installed setuid root?

わからないので、私はsudo brew updateを実行しようとしただったと得たものを確認してください。私は(ディスクユーティリティを使用して応急処置を実行している)の提案hereを試してみました

ls: is: No such file or directory 
ls: is: No such file or directory 
ls: is: No such file or directory 
ls: is: No such file or directory 
ls: sudo: No such file or directory 
ls: sudo: No such file or directory 
ls: sudo: No such file or directory 
ls: sudo: No such file or directory 
-r-s--x--x 1 root  wheel 369136 Sep 13 20:56 /usr/bin/sudo 
-r-s--x--x 1 my_profile admin 168448 Jan 13 2016 /usr/local/bin/sudo 
-r-s--x--x 1 my_profile admin 168448 Jan 13 2016 /usr/local/bin/sudo 
-r-s--x--x 1 my_profile admin 168448 Jan 13 2016 /usr/local/bin/sudo 

が、私tは何の効果もないようです....

何が起こっているのか、私は何をする必要があるのでしょうか?あなたがls -la /usrを実行する場合

答えて

0

、結果はほとんどの場合、以下のようになります:

total 0 [email protected] 11 root wheel 374 Oct 14 14:35 . drwxr-xr-x 32 root wheel 1156 Oct 26 09:49 .. drwxr-xr-x 19 root wheel 646 Oct 10 18:51 local ... (some other files and directories)

今、それは明らかだからそれ以上のあなたはrootとしてログインしているか、ユーザーがwheelでない限り、 (おそらくそうではない)、書き込み許可が必要なユーザーに発行するコマンド(たとえば、brew update)は失敗します。

可能な解決策の1つ(と私は最高のものと主張していない)は、/usr/localの許可を変更することです。そのよう

:あなたは

brew update

を実行する場合興味深いことに

sudo chown -R $(whoami) /usr/local

は、すべてうまくいくと次のようなメッセージが出ます:

=> Migrating HOMEBREW_REPOSITORY (please wait)... ==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew! Homebrew no longer needs to have ownership of /usr/local. If you wish you can return /usr/local to its default ownership with: sudo chown root:wheel /usr/local

私は最初に何が起こったのか推測します。

希望に役立ちます。

関連する問題