Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew installation presented with error

On installation of homebrew I am presented with this error, could someone please explain what is happening and the solution?

==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/Cellar/git/2.19.1/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/usr/local/Homebrew/.git/hooks/fsmonitor-watchman.sample':
 Permission denied
Failed during: git init -q
like image 850
Jack Avatar asked Nov 18 '25 10:11

Jack


1 Answers

You have to give Homebrew the right to write inside /usr/local. To do this the official command to run is:

cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks

Read the official troubleshooting page of Homebrew for details.

If you have not installed applications in /usr/local that rely on specific permissions, you can also run:

sudo chown -R $(whoami) /usr/local/*
like image 57
Ortomala Lokni Avatar answered Nov 21 '25 09:11

Ortomala Lokni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!