homebrew - sbin - usr/local/lib/pkgconfig is not writable
Homebrew: Could not symlink,/usr/local/bin is not writable (10)
For those who are looking for
is not writable error:
It could be
. You just need to create that folder with:
sudo mkdir someOtherFolderName
First create the
folder, note that this requires
sudo mkdir sbin
sudo chown -R $(whoami) $(brew --prefix)/*
brew link yourPackageName
is displaying the following issues while installing a dependency:
Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/a2x /usr/local/bin is not writable. You can try again using: brew link asciidoc
I was able to resolve this issue; seems this to be an issue non specific to the packages being installed but of the permissions of
sudo chown -R `whoami`:admin /usr/local/bin
For some packages, you may also need to do this to
sudo chown -R `whoami`:admin /usr/local/share sudo chown -R `whoami`:admin /usr/local/opt
For those running into this issue (granted 4 years after this post was made) while running Mac OS High Sierra - the steps outlined here solved the problem for me. Essentially just outlines uninstalling and reinstalling brew.
After running those steps,
worked like a charm!
For those that are not familiar:
sudo chown -R YOUR_COMPUTER_USER_NAME PATH_OF_FILE
I found same problem, we can resolve in three steps:-
sudo chown -R $(whoami) $(brew --prefix)/*
If you still get any linking problem, lets say for
, just write
brew link mysql
This will work.
I've found the following relevant for Sophos Anti-Virus users:
In short, Sophos is changing permissions of certain /usr/local directories. Sophos has patched this and the fix is included with version 9.4.1.
If you go to the folder in finder, right click and select "Get Info" you can go to the "Sharing and Permissions" section for the folder and allow "Read & Write" to "everyone"
This is what I do to make symlinks pass with this error. Also brew seems to reset the permissions on the folder also as if you hadn't altered anything
My problem was
Error: Could not symlink share/man/man7/ABORT.7 /usr/local/share/man/man7 is not writable.
didn't help, but i followed running
advices and this warning helped me:
Warning: Broken symlinks were found. Remove them with `brew prune`: /usr/local/share/man/man3/*
all worked fine!
The other answers are correct, as far as they go, but they don't answer why this issue might be occurring, and how to address that root cause.
There are two possible causes to this issue:
- The homebrew installation was performed with a user other than the one you are currently using. Homebrew expects that only the user that installed it originally would ever want to use it.
You installed some software that writes to /usr/local without using brew. This is the cause
brew doctorsuggests, if you run it.
If you have multiple user accounts, and you want more than one of them to be able to use brew, you need to run through a few steps, otherwise you will constantly have to change ownership of the Homebrew file structure every time you switch users, and that's not a great idea.
Detailed instructions can be found online , but the quick answer is this:
Create a group named brew:
- Open System preferences
- Click Accounts
- Click the "+" (unlock first if necessary)
- Under New account select Group
- enter brew
- Click Create Group
- Select the brew group, and add the user accounts you want to use brew to it.
change the /usr/local folder group ownership:
sudo chgrp -R brew /usr/local
change the permissions to add write to /usr/local as group:
sudo chmod -R g+w /usr/local
change homebrew cache directory group:
sudo chgrp -R brew /Library/Caches/Homebrew
change the homebrew cache directory permissions:
sudo chmod -R g+w /Library/Caches/Homebrew
Single User Homebrew
If you're not trying to use more than one user with Homebrew, then the solution provided by the other answers, based on the suggestions of
is probably sufficient:
sudo chown -R $(whoami) /usr/local
sudo chown -R $(whoami) /Library/Caches/Homebrew
After these steps,
should report success by any user in the
group, assuming you've logged out and back in to apply the new group memberships (if you went the multiuser route). If you just corrected things for single user homebrew, then logging out and back in shouldn't be necessary as none of your group memberships have changed.
This is because the current user is not permitted to write in that path. So, to change r/w (read/write) permissions you can either use 1. terminal, or 2. Graphical "Get Info" window.
1. Using Terminal
Google how to use chmod/chown (change mode/change owner) commands from terminal
2. Using graphical 'Get Info'
Remember to change the permission back to "read only" after your temporary work, if possible