Homebrew Symlink Error

前端 未结 5 884
小鲜肉
小鲜肉 2021-01-29 23:57

I am trying to install memcached using:

brew install memcached

This ends in error about homebrew not being able to create a symlink:

         


        
相关标签:
5条回答
  • 2021-01-30 00:30

    It seems that since El Capitan the file permissions in /usr/local have been changed, causing the above problem for me.

    Instead of the chosen solution I suggest to do a:

    sudo chown -R :staff /usr/local
    

    This will work for all users

    0 讨论(0)
  • after i performed the suggestions in @septerr answer, i still was unable to install carthage via homebrew... after some googleing i found this: Gist https://gist.github.com/dalegaspi/7d336944041f31466c0f9c7a17f7d601

    Anyway... got this:

    Error: An unexpected error occurred during the 'brew link' step The formula built, but is not symlinked into /usr/local Permission denied @ dir_s_mkdir - /usr/local/Frameworks Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

    did this:

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

    and

    sudo install -d -o $(whoami) -g admin /usr/local/Frameworks

    after that is was able to install carthage successfully

    0 讨论(0)
  • 2021-01-30 00:41

    As of High Sierra, /usr/local is no longer chown-able. The new procedure suggested in a Homebrew issue is:

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

    FYI: If required /usr/local subfolders (e.g. ./include or ./Frameworks) are missing, you'll have to mkdir them first

    0 讨论(0)
  • 2021-01-30 00:45

    Thanks for updating your own question this helped me a lot. I fixed this issue by making all locations in /usr/local writable to group as I am already in the admin group.

    To do this just use the following command

    sudo chmod -R g+w /usr/local
    
    0 讨论(0)
  • 2021-01-30 00:46

    I uninstalled what homebrew had so far installed (libevent dependency):

    brew uninstall libevent
    

    Then chow-ned the usr/local directory:

    sudo chown -R $(whoami) /usr/local
    

    Then tried to install memcached again and it worked:

    brew install memcached
    
    0 讨论(0)
提交回复
热议问题