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

前端 未结 4 1730
半阙折子戏
半阙折子戏 2020-12-25 12:40
Warning: Could not link pkg-config. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Yo         


        
相关标签:
4条回答
  • 2020-12-25 13:03

    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.

    0 讨论(0)
  • 2020-12-25 13:09

    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.

    0 讨论(0)
  • 2020-12-25 13:23
    1. reinstall command line tools: https://developer.apple.com/downloads/index.action
    2. brew link --overwrite --dry-run pkg-config
    0 讨论(0)
  • 2020-12-25 13:25
    1. brew reinstall pkg-config
    2. rm -R offending-directory
    3. repeat step 1
    0 讨论(0)
提交回复
热议问题