Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am installing a few Homebrew packages on a brand new Mac. However, there are some errors while linking:

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

So SVN isn't really installed correctly, as we can see here:

charon:~ werner$ which svn

Same error for Git:

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

However, this one's installed correctly:

charon:~ werner$ which git

Should I just chmod the lib directory or is there anything else I should preferably do?

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
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
share|improve this question
up vote 91 down vote accepted

As of writing, Homebrew requires the contents of /usr/local to be chown'd to your username. This doesn't seem like a great solution, but it works, and is evidently the recommended use. See:

You can do:

sudo chown -R `whoami` /usr/local
share|improve this answer
Also worth checking out: Fix permissions on /usr/local for Homebrew — Gist – slhck Jul 18 '12 at 0:08
this fixed my installation issue with TMUX as well, thanks – chrishough Dec 8 '12 at 11:40
i had an errors when linking my pcre and the message like this one Error: Permission denied - /usr/local/share/doc/pcre/README ... this command fix that.. thx a lot – risnandar Jul 12 '13 at 14:22
Awesome!Thanks for the simple solution! – RockyMountainHigh Jun 9 '14 at 14:58
This works, but upon restarting, i have to run it again on osx 10.10 – Jamie S Jan 7 at 23:10

Try sudo ln -s /usr/local/Cellar/git/.../bin/git /usr/local/bin/git

share|improve this answer
What does this mean? Do you want to overwrite git with wget, or…? – slhck Oct 24 '14 at 6:59
This is not a good answer. You should add something: What do the three dots mean? What will this do? Why are you replacing the git executable? Why should it help? – pabouk Oct 24 '14 at 7:01
Sorry , I resolved a similar issue with brew wget, if you make manually a symlink (ln) it seems to work. And is better than change the directory permissions – Emilio Borraz Oct 24 '14 at 17:20
It's not really better because the symlink should have been there in the first place if the permissions had been correct. You're just going to run into problems with other formulas sooner or later. You need to own /usr/local, and there is no real downside to it. – slhck Oct 24 '14 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .