Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew install - permission denied (after chown -R `whoami` )

Tags:

macos

homebrew

$ brew install fontconfig
Error: Permission denied - /Library/Caches/Homebrew/Formula/fontconfig.brewing

$ sudo chown -R `whoami` /usr/local

$ brew install fontconfig
Error: Permission denied - /Library/Caches/Homebrew/Formula/fontconfig.brewing

Not sure where to go from here. Ran brew doctor to fix some existing issues, but can't seem to get past this.

like image 775
kyletaylored Avatar asked Jul 01 '13 04:07

kyletaylored


2 Answers

trojanfoe's answer helped. There was a permission issue with the Library/Logs folder that I wasn't assigned to, but somehow the Library/Caches/Homebrew folder didn't exist. So I just created that, the subfolder Formula, and changed the permission and everything installed just fine. It actually cleared up a lot of errors I was having.

Thanks everyone.

Update

@fet's one liner works great.

mkdir -p ~/Library/Caches/Homebrew/Formula
like image 113
kyletaylored Avatar answered Sep 27 '22 02:09

kyletaylored


For others that are running into the error of something like

$ brew upgrade
==> Upgrading 1 outdated package, with result:
libtool 2.4.6
==> Upgrading libtool
Error: Permission denied - /usr/local/lib/libltdl.7.dylib

Make sure that your directory, in this case /usr/local/lib, has sufficient permissions for you to access it. I ran into the issue where it was only assigned to root:admin.

$ ls -la /usr/local/lib/ | grep "libltdl.7"
lrwxr-xr-x   1 username  admin        43 Oct 12  2014 libltdl.7.dylib -> ../Cellar/libtool/2.4.2/lib/libltdl.7.dylib

Switched that to myusername:admin and was able to upgrade with no problems.

cd /usr/local/lib
sudo chown `whoami`:admin .

Hope that helps!

like image 27
ph1ash Avatar answered Sep 26 '22 02:09

ph1ash