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

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

1.昨天百度了一天,都都沒有找到解決方案。由於昨天是20161130日,個人藍燈FQ軟件的流量使用光了。悲催~spa

2.今天是20161201日,我能夠無償使用藍燈了。就一個谷歌第一個就提供瞭解決方案。能夠說是2分鐘內就解決了。code

因此,期待谷歌進入中國吧。blog

3.開始記博客:homebrew

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

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.

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

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

而後再安裝你須要的軟件經過:brew install softname;博客

不過,若是仍是遇到不能安裝的狀況,就根據提示內容再次給當前用戶賦予相應的目錄權限(這裏系統會提示),你只要根據提示操做就好了。it

在我執行上面的命令以後,我想安裝軟件:io

又提示了一下錯誤:

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

而後,再次安裝我須要的軟件,問題解決了。

若是後面還有錯誤提示,就再次根據提示操做。直到問題解決。

谷歌就是好!

相關文章
相關標籤/搜索