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!
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
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
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
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
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
Symlink errors prevented
brew install pyenv
on macOS Big Sur 11.6.2.
Solution suggested by #sean-denigris worked
sudo chown -R $(whoami) $(brew --prefix)/*
Before this I had tried the solution proposed by #marko
sudo chmod -R g+w /usr/local
that gave the following error
chmod: Unable to change file mode on /usr/local: Operation not permitted
Related
I installed wget with brew install wget, and tried to link with brew link wget. Then I got Error: Could not symlink share/locale/bg/LC_MESSAGES/wget-gnulib.mo /usr/local/share/locale/bg/LC_MESSAGES is not writable.
Trying sudo chown -R jinglin:admin /usr/local/share/locale/be/LC_MESSAGES and sudo chmod a+rwx /usr/local/share/locale/be/LC_MESSAGES did not help.
Anyone had the same problem and know how to solve? Thanks a lot!
In case someone run into the same issue, this line solved my problem:
sudo chown -R $(whoami) $(brew --prefix)/*
I want to install neovim but I'm getting the following error:
Permission denied # dir_s_mkdir - /usr/local/share
How can I fix this?
Recommended solution:
$ sudo install -d -o $(whoami) -g admin /usr/local/share
A not-so-elegant solution to give permission:
$ sudo chown -R $(whoami) $(brew --prefix)/*
When installing mongodb with brew I get the following error
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
[BorisGrunwald#boriss-mbp Downloads]$
Anyone know what might be the cause for this?
Colin, brew not support sudo anymore.
Boris try this:
sudo mkdir /usr/local/Frameworks
sudo chown -R $(whoami) /usr/local/Frameworks
brew link --overwrite python#2
brew is not having write permissions for /usr/local directory.
Try changing the permission using below command
sudo chown -R : *
try unsing sudo to set the Permissions :
sudo brew install ...
I've tried all of:
sudo chown -R $USER /usr/local
sudo chown -R :admin /usr/local
sudo chown -R `whoami` /usr/local
sudo chmod -R 777 /usr/local
sudo find /usr/local -perm -200 -exec chmod g+w '{}' \+
And still /usr/local seems to be unwriteable to homebrew installs. For example:
/usr/local master
❯ brew update
Already up-to-date.
/usr/local master
❯ brew install fontconfig
==> Downloading https://homebrew.bintray.com/bottles/fontconfig-2.11.1.yosemite.
######################################################################## 100.0%
==> Pouring fontconfig-2.11.1.yosemite.bottle.3.tar.gz
Error: Permission denied - /usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf
I am tearing my hair out searching forums and like-questions and finding no resolution to this. I even tried different shells, such is the degree of my frustration. Especially given the permissions:
❯ ls -lad /usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf
-rwxrwxrwx# 1 centzon admin 1.9K May 5 14:33 /usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf
The accepted answer here brew install - permission denied (after chown -R `whoami` ) did not work for me on Yosemite 10.10.3
The following worked (the homebrew equivalent of "turn it off, and turn it back on again"), but it does not explain wny sudo chown -R `whoami` /usr/local did not.
/usr/local/etc master
❯ sudo rm -rf fonts
❯ brew install fontconfig
.
.
.
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall fontconfig`
❯ brew postinstall fontconfig
.
.
.
Re-scanning /Library/Fonts: /usr/local/var/cache/fontconfig/8d7231e6733a9725c81b40e9f55f11b1-le64.cache-4: Permission denied
❯ sudo rm -rf /usr/local/var/cache/fontconfig
❯ brew postinstall fontconfig
DICE!
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
You can try again using `brew link pkg-config`
brew reinstall pkg-config
rm -R offending-directory
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.
reinstall command line tools: https://developer.apple.com/downloads/index.action
brew link --overwrite --dry-run pkg-config