How to Fix Homebrew "Permission Denied" on macOS

Updated

Learn how to fix the "Permission Denied" error in Homebrew on macOS

How to Fix Homebrew "Permission Denied" on macOS

First, let's open Terminal. We will resolve this error by changing the ownership of the Homebrew folders to your current user account.

If you are using an Apple Silicon Mac with an M1, M2, M3, or M4 chip, run this command:

sudo chown -R $(whoami) /opt/homebrew/*

If you are using an Intel Mac, run this command instead:

sudo chown -R $(whoami) /usr/local/*

When you press enter, Terminal will ask for your password. As a quick heads-up, no characters or dots will appear on screen while you type your password, so just enter it calmly and press enter.

Give it a few seconds to finish updating the permissions across all your Homebrew files.

Now, let's do a quick test to make sure everything is working properly. Run brew doctor to check for any remaining issues.

As a helpful tip, you can run brew update && brew upgrade to confirm that Homebrew can update your packages without throwing permission errors again.