安装 Mountain Lion 后纠正 Mac 上的权限

安装 Mountain Lion 后纠正 Mac 上的权限

从 Snow Leopard 升级到 Mountain Lion 影响了我使用的很多软件。当我尝试在系统上更新和安装一些 Ruby 和其他软件(使用 Homebrew)时,我收到了此错误消息

Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.

有人知道我如何将 /usr/local 的所有权和权限改回我的用户帐户吗?

答案1

Homebrew 告诉你该怎么做:

您可能应该将 /usr/local 的所有权和权限改回您的用户帐户。

为此,我们将使用chown并(递归地)将您的用户设置为所有者/usr/local

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

这个 GitHub Gist 做了同样的事情,甚至更多,这可能是也可能不是再次获得完全正常工作的 Homebrew 所必需的:修复 Homebrew 的 /usr/local 权限

相关内容