Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew install fails while copying files

I run this:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

I get prompt:

==> 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

After I click "return"(enter button) I get this error:

==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/git/share/git-core/templates/hooks/pre-receive.sample' to '/usr/local/Homebrew/.git/hooks/pre-receive.sample': Permission denied
Failed during: git init -q

Any ideas what kind of error I am facing and what can be done? It is not really clear for me as it is first time I am facing something like this.

like image 622
Mindaugas Avatar asked Nov 14 '16 15:11

Mindaugas


People also ask

How long should Homebrew take to install?

On a 1 Mbps Internet connection, installing Homebrew would, in theory, take about ~1 hour. As a one-time setup cost, this isn't too bad. However, it would be nice to make this better, especially given that most of the data transferred is git metadata that most users won't be making direct use of themselves.

What is git mirror of Homebrew brew?

With homebrew, people can get their software and dependencies installed by simply running a command in their terminals. This mirror synchronizes Homebrew Formula Index from https://github.com/Homebrew .

How much space does Homebrew take up Mac?

In order to install Homebrew, you need to install either the Xcode Command Line Tools (about 100 MB) or the full Xcode package (about 10 GB).


1 Answers

You are getting permission denied when downloading the files into /usr/local.

This folder often belongs to root. This is a known issue with brew. Fix it by doing

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

and then re-run the installer.

like image 60
Harald Nordgren Avatar answered Oct 07 '22 13:10

Harald Nordgren