在使用 macOS Catalina 更新将我的 shell 从 bash
切换到 zsh
之后,Homebrew 和 zsh 正在争论他们如何需要 /usr/local/share/zsh/site-functions
和 0x25181223113431。
zsh 更喜欢 /usr/local/share/zsh
由 /usr/local/share/zsh/**/*
拥有,否则会引发烦人的错误
zsh compinit: insecure directories and files, run compaudit for list.
Ignore insecure directories and files and continue [y] or abort compinit [n]?
每次我以 root 身份登录时,例如通过
root
。我以 root 身份运行
sudo -s
然后 compaudit
'd 和 chown root
'd 列出的所有目录。满意 chmod g-w
但现在 zsh
不高兴。任何
homebrew
brew
或 install
失败Error: The following directories are not writable by your user:
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions
And make sure that your user has write permission.
chmod u+w /usr/local/share/zsh /usr/local/share/zsh/site-functions
upgrade
给出与警告相同的消息。两者之间有妥协吗?或者我可以安全地抑制这些警告之一?如果是这样,如何?
最佳答案
我只是通过在我的 .zshrc
文件中添加以下行来使消息没有出现。
ZSH_DISABLE_COMPFIX="true"
如果不起作用,请尝试在 .zshrc
文件的第一行添加该行。关于macos - 如何安全地解决 Homebrew 软件和 zsh 对/usr/local/share/zsh 所有权的冲突需求?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58419760/