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


首先提示一點:能谷歌絕對不要百度解決問題。

1.昨天百度了一天,都都沒有找到解決方案。因為昨天是20161130日,我的藍燈翻牆軟件的流量使用光了。悲催~

2.今天是20161201日,我可以免費使用藍燈了。就一個谷歌第一個就提供了解決方案。可以說是2分鍾內就解決了。

所以,期待谷歌進入中國吧。

3.開始記博客:

homebrew 無法安裝,提示不能在根目錄下使用。

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.

解決思路就是給當前用戶添加目錄權限:

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

然后再安裝你需要的軟件通過:brew install softname;

不過,如果還是遇到不能安裝的情況,就根據提示內容再次給當前用戶賦予相應的目錄權限(這里系統會提示),你只要根據提示操作就行了。

在我執行上面的命令之后,我想安裝軟件:

又提示了一下錯誤:

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

我根據提示再次執行命令:

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

然后,再次安裝我需要的軟件,問題解決了。

如果后面還有錯誤提示,就再次根據提示操作。直到問題解決。

谷歌就是好!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM