【问题标题】:What does "You should probably `chown` them" mean?“你可能应该 `chown` 他们”是什么意思?
【发布时间】:2013-06-17 21:18:06
【问题描述】:

我刚刚安装了 Homebrew。当我运行brew doctor 时,我得到了这个

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

“你可能应该‘chown’他们”是什么意思?有人能解释一下 Homebrew 到底想让我做什么吗?

【问题讨论】:

  • chown 意思是:改变所有权。
  • 我真的不明白为什么这个问题被关闭了。这是关于自制程序的,它是程序员用于编程的包管理器。在我看来,这完全属于 SO 的范围。
  • 我认为这有点牵强,它与编程无关——更多地属于Super UserUnix & LinuxAsk Different 部分。

标签: macos osx-mountain-lion homebrew


【解决方案1】:

好的,chown 是用于更改文件所有权的 unix 命令。

Homebrew 要求我更改 /usr/local/share/man/de 的所有权,以便 Homebrew 可以对其进行写入。 Homebrew 以与我相同的权限运行,因此让自己成为文件的所有者应该可以解决问题。

运行以下解决问题:

sudo chown $(whoami) /usr/local/share/man/de

【讨论】:

  • 应该是 sudo chown myusername /usr/local/share/man/de
  • 节省 1000 毫秒写入您的用户名 sudo chown $(whoami) /usr/local/share/whatever
  • 一点要添加,如果您想递归更改它,即子文件夹和文件也使用 add -R
【解决方案2】:

事实上,一个简单的命令就可以完成所有工作。
sudo chown $(whoami) /usr/local/share/man/*/man1

【讨论】:

    【解决方案3】:

    检查所有者和权限:

    ls -la /usr/local/share/man/ | grep de; ls -la /usr/local/share/man/de/ | grep man1
    

    改变它:

    /usr/bin/sudo /usr/bin/chgrp admin /usr/local/share/man/de /usr/local/share/man/de/man1
    
    /usr/bin/sudo /bin/chmod g+rwx /usr/local/share/man/de /usr/local/share/man/de/man1
    

    现在您可以毫无问题地使用brew ;-)

    Your system is ready to brew.
    

    【讨论】:

      【解决方案4】:

      chown 用于更改谁拥有文件的所有权。在这种情况下,对sudo 的引用意味着以超级用户身份安装的文件在由普通用户运行时将无法通过 Homebrew 访问,从而使这些选项无用,并且如果尝试使用此类文件,很可能会导致错误或不希望的结果访问

      【讨论】:

        猜你喜欢
        • 2019-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-03-01
        • 1970-01-01
        • 2016-02-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多