Fixing homebrew permissions after osx update

The problem:

[code language=”bash”]
brew update
error: unable to unlink old ‘.gitignore’ (Permission denied)
error: unable to unlink old ‘.yardopts’ (Permission denied)
error: unable to unlink old ‘README.md’ (Permission denied)
error: Your local changes to the following files would be overwritten by merge:
.gitignore
README.md
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull –quiet origin refs/heads/master:refs/remotes/origin/master
[/code]

The solution:

[code language=”bash”]
#sudo chown denbox:admin /usr/local;
sudo chown $(USER):admin /usr/local
[/code]

Sources:
https://github.com/Homebrew/homebrew/issues/41665
http://osxdaily.com/2013/04/23/change-file-ownership-mac-os-x/

Leave a Reply