【问题标题】:`brew link unbound` returns `/usr/local/sbin is not writable` error`brew link unbound` 返回 `/usr/local/sbin is not writable` 错误
【发布时间】:2018-06-23 21:17:13
【问题描述】:

我正在尝试使用brew 命令安装unbound

这是brew install unbound 的输出:

Warning: unbound 1.6.7 is already installed, it's just not linked.
You can use `brew link unbound` to link this version.

如您所见,我被要求使用 brew link unbound 链接到未绑定的 1.6.7。

但我未能链接到它,因为我收到以下错误:

Linking /usr/local/Cellar/unbound/1.6.7...
Error: Could not symlink sbin/unbound
/usr/local/sbin is not writable.

我有另一个 stackoverflow here

答案sudo chown -R $(whoami) /usr/local 会产生以下错误:

chown: /usr/local: Operation not permitted

我使用的是 macOS High Sierra 版本 10.13.2。

我该如何解决这个问题?

【问题讨论】:

    标签: installation homebrew


    【解决方案1】:

    以下命令解决了我的问题。

    sudo mkdir /usr/local/sbin
    sudo chown -R $(whoami) /usr/local
    brew link unbound
    

    【讨论】:

    • 我认为你应该只运行sudo chown -R $(whoami) /usr/local/sbin。如果您完全覆盖 /usr/local 文件夹本身的所有权,则可能存在安全问题。我自己并不知道为什么 /usr/local 总是由 root 拥有的所有含义,如果我不需要,我不想打破这个假设。
    • @AlexanderBird 不。必须是某个受保护的系统文件夹:TimComp:myfolder tim$ sudo chown -R $(whoami) /usr/local/sbin chown: /usr/local/sbin: No such file or directory TimComp:myfolder tim$ brew link --overwrite unbound Linking /usr/local/Cellar/unbound/1.10.0... Error: Could not symlink sbin/unbound /usr/local/sbin is not writable.
    猜你喜欢
    • 1970-01-01
    • 2018-06-22
    • 2023-03-05
    • 2022-10-17
    • 1970-01-01
    • 2014-12-17
    • 1970-01-01
    • 2012-07-05
    • 2019-08-07
    相关资源
    最近更新 更多