Skip to content

Instantly share code, notes, and snippets.

@irazasyed
Last active November 13, 2024 00:27
Show Gist options
  • Save irazasyed/7732946 to your computer and use it in GitHub Desktop.
Save irazasyed/7732946 to your computer and use it in GitHub Desktop.
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

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

@bubbleee030
Copy link

None of the above worked for me. Keep getting permissions errors when updating homebrew.

Example Permission Denied Error:

/Users/{insert username}/Library/Caches/Homebrew/api/formula_names.before.txt: Permission denied The solution that worked was just deleting the cache files:

sudo rm -rf ~/Library/Caches/Homebrew/

Additionally, ran the following for good measure:

sudo chown -R {your username}:admin ~/Library/Caches/Homebrew/
sudo chmod -R 755 ~/Library/Caches/Homebrew/

Then reinstall Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

worked for me on Sonoma 14.5, thanks bro

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