Skip to content

Instantly share code, notes, and snippets.

@jrenggli
Last active April 3, 2022 23:32
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jrenggli/bc0958ec4eabadf1602e8b82344324ff to your computer and use it in GitHub Desktop.
Save jrenggli/bc0958ec4eabadf1602e8b82344324ff to your computer and use it in GitHub Desktop.
Fix homebrew permissions
sudo chown -R $(whoami) /usr/local/Cellar
sudo chown -R $(whoami) /usr/local/Homebrew
sudo chown -R $(whoami) /usr/local/var/homebrew
sudo chown -R $(whoami) ${HOME}/Library/Caches/Homebrew
sudo chown -R $(whoami) ${HOME}/Library/Logs/Homebrew
sudo chown -R $(whoami) /usr/local/etc
sudo chown -R $(whoami) /usr/local/opt
sudo chown -R $(whoami) /usr/local/bin
sudo chown -R $(whoami) /usr/local/var
sudo chown -R $(whoami) /usr/local/share/man/man1
sudo chown -R $(whoami) /opt/homebrew-cask
@jonkislin
Copy link

Thank you for this! Works like a charm

@ginader
Copy link

ginader commented Jun 11, 2018

to be able to update imagemagick I also needed to add:
sudo chown -R $(whoami) /usr/local/share

@olange
Copy link

olange commented Nov 21, 2019

worked like a charm too for me, after upgrade to OS Catalina. I had to update permissions of /usr/local/lib to update Subversion too:
sudo chown -R $(whoami) /usr/local/lib

@snacks-lord
Copy link

How would you run this for another user? i.e. console/logged in user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment