2013-06-20 118 views
26

我剛安裝了自制軟件。當我運行brew doctor我得到這個什麼「你應該可以`chown`他們」是什麼意思?

Warning: Some directories in /usr/local/share/man aren't writable. 
This can happen if you "sudo make install" software that isn't managed 
by Homebrew. If a brew tries to add locale information to one of these 
directories, then the install will fail during the link step. 
You should probably `chown` them: 

    /usr/local/share/man/de 

什麼是「你或許應該`CHOWN」他們」是什麼意思?有人可以解釋什麼是家釀要我做的?

+1

chown表示:更改所有權。 – bouscher

+1

我真的不明白爲什麼這個問題已經關閉。這是關於自制程序,它是程序員用於編程的程序包管理器。似乎我完全落在SO的範圍之內。 –

+0

我認爲這有點兒延伸,它並不是真正與編程相關的 - 更多的屬於「超級用戶」,「Unix&Linux」或「Ask Different」部分。 – vol7ron

回答

61

好吧,所以chown是更改文件所有權的unix命令。

Homebrew要求我更改/usr/local/share/man/de的所有權,以便Homebrew可以寫信給它。 Homebrew和我一樣擁有相同的權限,因此讓自己成爲文件的所有者應該解決問題。

運行下面的解決了這個問題:

sudo chown $(whoami) /usr/local/share/man/de 
+7

它應該是sudo chown myusername/usr/local/share/man/de – andreimarinescu

+2

保存1000毫秒寫你的用戶名 'sudo chown $(whoami)/ usr/local/share/whatever' –

+1

好的打電話給Alon。 –

2

chown用於更改誰擁有文件的所有權。在這種情況下,對sudo的引用意味着作爲超級用戶安裝的文件在由常規用戶運行時不會被自制程序訪問,從而使這些選項無效,並且如果嘗試訪問這樣的文件,最有可能導致錯誤或不期望的結果

4

檢查所有者和許可權:

ls -la /usr/local/share/man/ | grep de; ls -la /usr/local/share/man/de/ | grep man1 

更改:

/usr/bin/sudo /usr/bin/chgrp admin /usr/local/share/man/de /usr/local/share/man/de/man1 

/usr/bin/sudo /bin/chmod g+rwx /usr/local/share/man/de /usr/local/share/man/de/man1 

現在你可以使用brew沒有任何問題;-)

Your system is ready to brew. 
3

其實,一個簡單的命令應該可以做所有的工作。
sudo chown $(whoami) /usr/local/share/man/*/man1