【问题标题】:Permission denied - /Library/Caches/Homebrew/Formula/nmap.brewing权限被拒绝 - /Library/Caches/Homebrew/Formula/nmap.brewing
【发布时间】:2013-07-12 08:10:59
【问题描述】:

我在我的 macbook pro (OSX 10.8.4) 上创建了一个新用户“爸爸”。 “爸爸”是管理员。我已经成功地将自制软件安装为“爸爸”。它以前是由另一个用户安装的。我做到了:

sudo chown -R dad /usr/local/
cd /usr/local/
chmod -R 777 *

但任何安装尝试,例如:

brew install nmap

给予:

Error: Permission denied - /Library/Caches/Homebrew/Formula/nmap.brewing

nmap.brewing 似乎不存在:

dad$ ls -l /usr/local/Library/Caches/Homebrew/Formula/nmap.brewing
ls: /usr/local/Library/Caches/Homebrew/Formula/nmap.brewing: No such file or directory

dad$ ls -l /Library/Caches/Homebrew/Formula/nmap.brewing
ls: /Library/Caches/Homebrew/Formula/nmap.brewing: No such file or directory

有什么想法吗?

【问题讨论】:

    标签: macos homebrew


    【解决方案1】:

    固定。

    看来我需要拥有 /Library/Caches/Homebrew

    sudo chown -R $USER /Library/Caches/Homebrew/
    

    【讨论】:

    • 感谢您的提示。我只需要将用户更改为我尝试在其中安装库的用户。sudo chown -R user /Library/Caches/Homebrew/
    • 不工作 :( brew install libiconv (...) Error: Permission denied - Users/myusername/Library/Logs/Homebrew/libiconv/01.configure
    • 感谢这有助于使用 Chef 安装 Homebrew。认为这是厨师的问题,是权限。很高兴知道!
    • 修复brew doctor 输出中的所有警告对我很有帮助。
    • 为什么 OS X 附带的包管理器不能开箱即用?
    【解决方案2】:

    brew manpage 中搜索/Library/Caches/Homebrew,事实证明您可以使用HOMEBREW_CACHE 环境变量设置自制软件用于缓存的目录,或者只创建~/Library/Caches/Homebrew。如果您是非管理员,这些方法将比 chown 方法更容易。

    【讨论】:

      【解决方案3】:

      我使用了以下命令:

      sudo chmod -R g+w /Library/Caches/Homebrew/Formula/

      sudo chgrp -R staff /Library/Caches/Homebrew/Formula/

      【讨论】:

        【解决方案4】:

        mkdir -p ~/Library/Caches/Homebrew echo 'export HOMEBREW_CACHE=~/Library/Caches/Homebrew' >> ~/.bash_profile 来源 ~/.bash_profile

        【讨论】:

          【解决方案5】:

          由于用户没有权限,所以直接使用命令

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

          【讨论】:

          • 因为用户没有权限
          猜你喜欢
          • 1970-01-01
          • 2022-09-30
          • 2015-08-30
          • 1970-01-01
          • 1970-01-01
          • 2018-07-19
          • 2017-06-19
          相关资源
          最近更新 更多