无法正确安装Brew公式(/ usr / local / lib中的权限被拒绝)


52

我在全新的Mac上安装了一些Homebrew软件包。但是,链接时会出现一些错误:

ln: ./libsvn_wc-1.dylib: Permission denied
Error: The linking step did not complete successfully
The package built, but is not symlinked into /usr/local
You can try again using `brew link subversion'
Error: Could not create symlink /usr/local/lib/libsvn_wc-1.dylib.
Check that you have permssions on /usr/local/lib
==> Summary
/usr/local/Cellar/subversion/1.6.15: 88 files, 6.0M, built in 38 seconds

因此,SVN并未真正正确安装,如下所示:

charon:~ werner$ which svn
/usr/bin/svn

Git的相同错误:

charon:~ werner$ brew link git
Error: Permission denied - /usr/local/lib/python2.6

但是,这个已正确安装:

charon:~ werner$ which git
/usr/local/bin/git

我应该只是chmodlib目录或者是还有什么我应该做的最好?

charon:~ werner$ ls -l /usr/local/
total 8
drwxr-xr-x   7 werner  staff   238 Mar  8 15:58 Cellar
drwxr-xr-x   6 werner  staff   204 Mar  8 14:21 Library
-rw-r--r--   1 werner  staff  1614 Mar  8 14:21 README.md
drwxr-xr-x  56 werner  staff  1904 Mar  8 15:59 bin
drwxr-xr-x   4 werner  staff   136 Mar  8 15:46 etc
drwxr-xr-x   3 werner  staff   102 Mar  8 15:59 include
drwxr-xr-x   3 root    wheel   102 Apr 17  2010 lib
drwxr-xr-x  12 werner  staff   408 Mar  8 15:57 share
drwxr-xr-x   4 root    wheel   136 Mar  8 14:43 texlive

Answers:


102

在撰写本文时,Homebrew要求将/ usr / local的内容修改为您的用户名。这似乎不是一个很好的解决方案,但是它可以工作,并且显然是推荐的用法。参见:https : //github.com/mxcl/homebrew/issues/9953#issuecomment-3800557

你可以做:

sudo chown -R `whoami` /usr/local


这也解决了我在TMUX上的安装问题,谢谢
Chris Hough 2012年

链接我的pcre和类似这样的消息时出现错误:错误:权限被拒绝-/ usr / local / share / doc / pcre / README ...此命令修复了很多问题
。– risnandar

这工作,但在重新启动时,我不得不在OSX 10.10再次运行
杰米小号
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.