Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew Symlink Error

Tags:

homebrew

I am trying to install memcached using:

brew install memcached

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

The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local

Help!

like image 647
septerr Avatar asked Jun 28 '12 01:06

septerr


4 Answers

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
like image 122
septerr Avatar answered Nov 15 '22 14:11

septerr


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

like image 33
Sean DeNigris Avatar answered Nov 15 '22 13:11

Sean DeNigris


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
like image 24
iain Avatar answered Nov 15 '22 12:11

iain


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

like image 7
Darkglow Avatar answered Nov 15 '22 14:11

Darkglow