mac安装brew遇到chown: /usr/local: Operation not permitted

在MAC上安装homebrew事先博客进行安装,根据步骤进行下去,同样在brew update的时候出现报错:Error: /usr/local must be writable! 错误,在该文章中也给出解决办法(sudo chown -R $(whoami) /usr/local),但是这种方法对于高版本的OS来说,是解决不了的,会报chown: /usr/local: Operation not permitted错误。

后来在https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx-10-13-high-sierra网页上给出了解决办法,下面简单总结一下:

先卸载已安装的homebrew,命令如下:

/usr/bin/ruby -e “ ( c u r l − f s S L h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / H o m e b r e w / i n s t a l l / m a s t e r / u n i n s t a l l ) " 然 后 重 新 安 装 : / u s r / b i n / r u b y − e " (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 然后重新安装: /usr/bin/ruby -e " (curlfsSLhttps://raw.githubusercontent.com/Homebrew/install/master/uninstall)"/usr/bin/rubye"(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

通过该方法直接获取最新的homebrew,出现预期效果。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值