brew update /usr/local is not writable

今天使用 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

按照提示执行

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

提示无权限,瞬间无语。

后来在 github 找到相同问题 issue
需要先卸载然后重新安装

卸载

sudo /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

安装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
本作品采用《CC 协议》,转载必须注明作者和本文链接
如果你不能把一件事很简单的讲清楚,那么你就是还不够了解。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!