Today I tried to install homebrew
on my macOS Mojave
, and came across following errors:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
......
Already up-to-date.
Error: Failed to link all completions, docs and manpages:
Permission denied @ rb_file_s_symlink - (../../../Homebrew/completions/zsh/_brew, /usr/local/share/zsh/site-functions/_brew)
Failed during: /usr/local/bin/brew update --force
After refering stackoverflow, I fixed it through following command:
$ sudo chown -R $(whoami) $(brew --prefix)/*
“`
sudo chown -R $(whoami) […]
“`
This has always bothered me (*not* just the `whoami` part BTW – https://github.com/Homebrew/brew/pull/5340/) – we’re going back from a fully-fledged multi-user UNIX system, to a single-user one. Anyone heard of groups? It’s fine for a single-user laptop but doesn’t work for a multi-user Mac.
How about make Homebrew multi-user-aware, and use this instead?
“`
sudo chgrp -R admin $(brew –prefix)/*
“`
Maybe a good idea!
“`
sudo chgrp -R admin $(brew –prefix)/*
“`
doesn’t work as expected – casks can’t be moved to the applications folder after running that command.
Hey guys, I’m a complete noob and just ran this (exactly) in terminal…
”
sudo chgrp -R admin $(brew –prefix)/*
”
I entered password, it returned “Error: Unknown command: –prefix”
then started to change permissions on stuff… Pop-ups asking for permissions on certain folders/apps, I denied while getting very anxious. Didn’t know how to stop it so I restarted the computer. I now wonder… WHAT have I done, is it serious? And how to fix it?
Any kind of damage estimation would be very appreciated.
Thanks
100% worked Jan 2024. thank you!
Thank you so much !!!
Thank you, this helped!
Thanks! It solved my problem
thx for the quick one liner fix
Thanks you for posting the fix. It solved the problem for me.
it works for me thanks.
What fixed it for me was uninstalling brew and then reinstalling it.
Uninstall Homebrew:
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)”
Then re-install it:
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
Found on stackoverflow: https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-mac-os-x-10-13-high-sierra
Thank you, this post saved me from a headache. Why is this not already part of the Homebrew installation script instead of having to type it?
glorious, this solved my issue quickly.