Install git via homebrew on mac osx 10.10 results in: Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2

I also met the same issue. I think we should change the readable permission to make sure any of the directories is readable by "all". So I tried the command: sudo chown -R $USER:admin /usr/local and then: brew link --overwrite git It works for me, hope it will also work for you.


From High Sierra, chown of /usr/local is not allowed. However you can still change permission the sub directories in /usr/local.

In my case, I had to create Frameworks in /usr/local and sudo chown -R $(whom) Frameworks. After that follow what brew doctor says.

The better way is to create subdirectory whatever you need and run

sudo chown -R $(whoami) $(brew --prefix)/*


For those with the new El Capitan OS, you'll need to update your permissions:

Open Terminal and type the following commands:

$ sudo chown -R $(whoami):admin /usr/local 
$ brew doctor 
$ brew update
$ brew link --overwrite git

The above solution will work for other brew installs like node, etc. Just replace the last line if you started the installation but encountered errors during the brew installation.