Homebrew: “Permission denied @ rb_file_s_symlink…”

In case you encounter this error below when doing brew update:


==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
Updated 1 tap (homebrew/core).
No changes to formulae.
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)
?  tfm git:(master) ? sudo chown -R $(whoami) $(brew --prefix)/*

Copy-and-paste the following in your terminal:

sudo chown -R $(whoami) $(brew --prefix)/*

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.