homebrew 無(wú)法安裝,提示不能在根目錄下使用。
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.
解決思路就是給當(dāng)前用戶添加目錄權(quán)限:
sudo chown -R $(whoami) /usr/local
然后再安裝你需要的軟件通過(guò):
brew install softname
不過(guò),如果還是遇到不能安裝的情況,就根據(jù)提示內(nèi)容再次給當(dāng)前用戶賦予相應(yīng)的目錄權(quán)限(這里系統(tǒng)會(huì)提示),你只要根據(jù)提示操作就行了。
在我執(zhí)行上面的命令之后,我想安裝軟件:
又提示了一下錯(cuò)誤:
Error: /usr/local/Cellar is not writable. You should change the
ownership and permissions of /usr/local/Cellar back to your
user account:
sudo chown -R $(whoami) /usr/local/Cellar
Error: Cannot write to /usr/local/Cellar
我根據(jù)提示再次執(zhí)行命令:
sudo chown -R $(whoami) /usr/local/Cellar
然后,再次安裝我需要的軟件,問(wèn)題解決了。
長(zhǎng)按(或掃碼)識(shí)別二維碼,關(guān)注~
陳不二
博客地址: http://www.chenbu2.com
簡(jiǎn)書(shū)地址: http://www.itdecent.cn/u/f4874eb81c5b
GitHub地址: https://github.com/ChenBu2
愛(ài)學(xué)啊合作講師: http://www.ixuea.com/
公眾號(hào): 陳不2
技術(shù)交流QQ群: 858499698
****歡迎一塊交流學(xué)習(xí)~****
喜歡的朋友記得點(diǎn)贊轉(zhuǎn)發(fā)分享哦!