在mac下执行brew update时出现以下错误提示
MacPC:~ liuxin$ brew update
Error: /usr/local must be writable!
以前一直默认用的好好的,突然出现这种情况导致不能正常使用,下面详细排查
MacPC:~ liuxin$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: /usr/local is not writable.
You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami) /usr/local
Warning: /usr/local is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. For example, upgrading
to OS X El Capitan has been known to do this. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this as well.
You should probably change the ownership and permissions of /usr/local
back to your user account.
sudo chown -R $(whoami) /usr/local
Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool
解决方法
根据上面的提示,执行以下命令
MacPC:~ liuxin$ sudo chown -R $(whoami) /usr/local
Password:
测试效果
MacPC:~ liuxin$ brew update
==> Installing git dependency: cctools
......
成功
© 走过岁月...... | Powered by LOFTER