macOS sierra brew权限问题
我升级系统到macOS sierra
后,用如下命令更新了homebrew
cd "$(brew —repo)" && git fetch && git reset —hard origin/master && 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
按照提示设置了,成功执行了brew update
然后在升级go的时候又遇到权限问题了,描述如下
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 macOS 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 install'
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用Mac作开发都应该打开root权限,不然很多文件无法修改
开机按
Command + R 启动, 进入终端
输入:
csrutil disable
重启
如果没有Recovery分区,会自动下载恢复工具,但网络真心慢,耐心等吧
任何一人系统安装盘,安装前也可进入终端的。
该命令只能在Recovery模式下有权限,我试过 Command + S启动,没权限执行
对了,这特性好像10.9后有的,之前的不用