之前在mac上已经安装过homebrew,并且也安装了flutter,这几天flutter更新到了1.0,想着把本地的也更新一下,结果在执行brew update
时,出现了错误:
➜ ~ 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
结果又提示:
➜ ~ sudo chown -R $(whoami) /usr/local
chown: /usr/local: Operation not permitted
想用root权限试一下:
➜ ~ sudo brew update
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
看来高版本的macos用这种方式是无办法搞定了,不过有万能的stackoverflow,就没有解决不了的问题:
其实也就是先卸载旧的homebrew,然后再安装新的,虽然曲折了点,但好歹把问题解决了,剩下的流程直接按照flutter doctor
提供的命令来执行就可以了。
网友评论