homebrew 無(wú)法安裝提示不能在根目錄下使用

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ā)分享哦!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容