[OSX] Error: Cowardly refusing to ‘sudo brew update’

問題

執行 sudo brew update 時出現如下錯誤訊息

 
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.

原因

brew 權限不正確

 
MBA:bin root# ls -la /usr/local/bin/brew*
-rwxr-xr-x  1 taien  admin  4913 Feb 11 20:46 brew
lrwxr-xr-x  1 taien admin    40 Oct 28  2015 brew-cask -> ../Cellar/brew-cask/0.58.0/bin/brew-cask

解決方法

 
sudo chown root:wheel /usr/local/bin/brew

416 comments

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

*