验证 OSX 上的权限

验证 OSX 上的权限

上周,我在一台运行 Mountain Lion 的新 Mac 上安装 Homebrew 时遇到了麻烦,我尝试添加 xcode 的命令行工具并安装 X11,并按照我在网上找到的大量其他方法操作。但这一切都让我不知所措,甚至到了我不知道自己做了什么的地步。因此,我决定将它视为一台新机器,清除硬盘并全新安装 Mountain Lion。

现在我已经完成了,如果我去磁盘实用程序验证磁盘权限,我会得到一大堆 xcode 和 X11 相关错误,我会运行权限修复,但似乎永远无法修复它们。有什么想法我可以做什么吗?最好再做一次全新安装吗?(全新安装有多干净,因为我不确定为什么会出现这些 X11 错误,因为我第一次擦除后没有再次安装它。。)

这是来自磁盘实用程序的日志(如下)注意我可以运行验证,然后修复,然后再次验证,是否会出现同样的问题?

Verifying permissions for “Macintosh HD”
Permissions differ on “usr/X11/bin/freetype-config”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/agvtool”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/ibtool”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/instruments”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/opendiff”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/xcode-select”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/xcodebuild”; should be lrwxr-xr-x ; they are -rwxr-xr-x .

Permissions verification complete

Repairing permissions for “Macintosh HD”
Permissions differ on “usr/X11/bin/freetype-config”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/X11/bin/freetype-config”
Permissions differ on “usr/bin/agvtool”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/bin/agvtool”
Permissions differ on “usr/bin/ibtool”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/bin/ibtool”
Permissions differ on “usr/bin/instruments”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/bin/instruments”
Permissions differ on “usr/bin/opendiff”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/bin/opendiff”
Permissions differ on “usr/bin/xcode-select”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/bin/xcode-select”
Permissions differ on “usr/bin/xcodebuild”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Repaired “usr/bin/xcodebuild”

Permissions repair complete

Verifying permissions for “Macintosh HD”
Permissions differ on “usr/X11/bin/freetype-config”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/agvtool”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/ibtool”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/instruments”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/opendiff”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/xcode-select”; should be lrwxr-xr-x ; they are -rwxr-xr-x .
Permissions differ on “usr/bin/xcodebuild”; should be lrwxr-xr-x ; they are -rwxr-xr-x .

Permissions verification complete

答案1

这些实际上不是权限错误——如果您查看详细的错误,例如Permissions differ on “usr/bin/xcodebuild”; should be lrwxr-xr-x ; they are -rwxr-xr-x .,差异在于第一个符号(lvs. -),它是项目类型,而不是权限标志。“应该是”类型,l表示符号链接,而-表示纯文件。在我的计算机上:

$ ls -l /usr/bin/xcodebuild
lrwxr-xr-x  1 root  wheel  5 Jul 13 16:35 /usr/bin/xcodebuild -> xcrun

我已经有一段时间没有更新 Xcode 了,所以有可能应该在最新版本中可能是一个纯文本文件;或者可能是您安装的 Xcode 不知为何出现了乱码。无论哪种情况,权限本身都没有问题。如果出现问题,那一定是……不同之处。

相关内容