许可被拒绝-/Library/Caches/Homebrew/Formula/nmap.busing



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

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.酿造不存在:

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

有什么想法吗?

已修复。

我似乎需要拥有/Library/Caches/Homebrew

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

在brew manpage中搜索/Library/Caches/Homebrew,可以使用HOMEBREW_CACHE环境变量设置自制程序用于缓存的目录,也可以只创建~/Library/Caches/Homebrew。如果您不是管理员,这些方法将比chown方法更容易。

我使用了以下命令:

sudo chmod-R g+w/库/缓存/自制/配方/

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

mkdir-p~/Library/Caches/Homebrewecho'export HOMEBREW_CACHE=~/Library/Caches/HOMEBREW'>>~/.bash_profilesource ~/.bash_profile

由于用户没有权限,只需使用命令

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

最新更新