Mac中更新安装gcc报错:Error: The following directories are not writable by your user
前几天为Mac搭建gcc的环境,在使用指令
brew install gcc
报错:
Error: **The following directories are not writable by your user:
/usr/local/share/doc
/usr/local/share/man
/usr/local/share/man/man1
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1
And make sure that your user has write permission.
chmod u+w /usr/local/share/doc /usr/local/share/man /usr/local/share/man/man1
大概长这样
出现这种情况是Mac里权限的问题
继续在终端输入:
sudo chown -R `whoami`:admin /usr/local/bin
sudo chown -R `whoami`:admin /usr/local/share
因为使用了sudo,可能会提示需要输入密码,直接输入Mac密码就行
然后就可以正常更新安装了
中间有一段下载速度慢,需要耐心等待
祝你好运!!!