How do I fix 'brew install pkg-config'?

笑着哭i 提交于 2019-11-30 01:42:19
  1. brew reinstall pkg-config
  2. rm -R offending-directory
  3. repeat step 1

As Michael Pigg said above, in my case it was the folder permission issue. I had to do the following:

sudo chmod 777 /usr/local/bin
sudo chmod 777 /usr/local/share/man/man1
brew link pkg-config

And after I'm done:

sudo chmod 755 /usr/local/bin
sudo chmod 755 /usr/local/share/man/man1

to restore the original permissions.

It may be a permissions issue on /usr/local/share. You need to have write permission in that directory for the link to complete. However, zsh will complain about the directory being insecure if you set the write permission. I gave the write permission to allow pkg-config to install and then removed it so that zsh would be happy.

  1. reinstall command line tools: https://developer.apple.com/downloads/index.action
  2. brew link --overwrite --dry-run pkg-config
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!