Osx
更改 OS X 系統文件夾的所有者是否安全?
我正在嘗試讓 Homebrew 工作。該程序的診斷工具給了我這些建議:
你可能應該
chown
/usr/local/etc…
您可能應該
chown
:/usr/local/share/man/de /usr/local/share/man/de/man1
因為這些目錄是不可寫的。我之前沒有更改過所有者或組。現在等的所有者是
root
,組是wheel
,我的使用者名是別的。在 OS X 上更改這些文件夾的所有者是否安全?我擔心我的使用者不會擁有所有權限,
root
因此其他應用程序會遇到問題,儘管我的帳戶是管理員帳戶。
以下是使該問題更易於搜尋的完整錯誤消息:
Warning: /usr/local/etc isn't writable. This can happen if you "sudo make install" software that isn't managed by by Homebrew. If a brew tries to write a file to this directory, the install will fail during the link step. You should probably `chown` /usr/local/etc 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 /usr/local/share/man/de/man1
如果這些目錄是由安裝程序(如 MacTeX 或 ImageMagick 安裝程序)或由
sudo easy_install
或sudo pip install
.更改這些目錄的所有者應該是安全的:
sudo chown $USER /usr/local/etc /usr/local/share/man/de{,/man1}
這顯示了按創建時間排序的 root 擁有的文件:
find /usr/local/{etc,share/man} -user root -exec stat -f '%B %N' {} \; | sort