Jack
Jack

Reputation: 61

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

Upvotes: 3

Views: 765

Answers (1)

Ortomala Lokni
Ortomala Lokni

Reputation: 62456

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/*

Upvotes: 3

Related Questions