Skip to content

Instantly share code, notes, and snippets.

Last active December 7, 2023 02:32
Star You must be signed in to star a gist
What would you like to do?
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

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

Copy link

my solution with link: /usr/bin/ruby -e "$(curl -fsSL"

and command: sudo chown -R "$(whoami)":admin /usr/local

it ":admin" for sum in user

MacOS BigSur 11.4

Copy link

Thank you ser!

Copy link

nnq1 commented Nov 10, 2022

great, you save my life

Copy link

In my case I had to setup a new local user on my machine and to remove the old one.
Then the folder ( defined by brew --prefix ) looses its owner.
With this the owner is set to the new local user and - it works!

Copy link

In my case, had this problem as I created a new user for development and installed brew in my original Mac OS Monterey user account. The mentioned solution solved my problem. Thanks !

Copy link

Nice~ Greate job!

Copy link

medwant commented Jun 13, 2023

Thanks! Worked for me (macOS Ventura 13.3.1)

Copy link

emivlp commented Oct 9, 2023

Hi ! how can i fix this
/Users/emvlp/.zprofile:24: permission denied: /opt/homebrew/bin/brew
Could someone tell me the steps?
Thank you so much !

Copy link

Tony-MK commented Oct 28, 2023

Thanks @erma4ina

Copy link

ignoracenfly commented Oct 29, 2023 via email

Copy link

MrMacvos commented Nov 1, 2023

and command: sudo chown -R "$(whoami)":admin /usr/local

it ":admin" for sum in user

Thanks, this worked for me!

(macOS Ventura 13.9, Intel Mac)

Copy link

Worked for me on Intel Mac with macOS Ventura 13.5. Thank you :)

Copy link

ignoracenfly commented Nov 16, 2023 via email

Copy link

daveqs commented Dec 7, 2023

Worked for me on Monterey 12.6.5! (Late 2016, Intel silicon)

Copy link

ignoracenfly commented Dec 7, 2023 via email

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