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

佐手、 提交于 2019-12-21 08:59:08

问题


$ 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.


回答1:


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



回答2:


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!



来源:https://stackoverflow.com/questions/17397544/brew-install-permission-denied-after-chown-r-whoami

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!