Error trying to update brew package manager

I tried updating brew:

sudo brew update 

But I got this error:

Error: your local changes in the following files will be overwritten with merge:

Enumeration of a large number of files

Error: crash while executing git pull http://github.com/mxcl/homebrew.git wizard

Any idea what is going wrong?

+47
homebrew package-managers macos
Aug 03 2018-11-21T00:
source share
6 answers

The accepted answer is correct, but incomplete. If you get an error message

Error: the following files of the unprocessed tree files will be overwritten by merging:

Then go to your terminal and run these commands

 cd /usr/local 

Then

 git reset --hard FETCH_HEAD 

Then

 git checkout Library 

It should be all right. Then run

 brew update 
+34
Oct 18 '14 at 9:24
source share

Let me add: cd /usr/local/git and then run git reset --hard FETCH_HEAD

+15
Mar 27 '13 at 8:58
source share

go to your terminal and run these commands

 cd /usr/local sudo git reset --hard FETCH_HEAD sudo git checkout Library 
+11
Dec 26 '14 at 17:47
source share

For those of you using OS X El Capitan, protecting your system integrity may be your problem.

If /usr/local already exists, run the following in Terminal:

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

If /usr/local does not exist:

First try creating /usr/local usual way:

 sudo mkdir /usr/local && sudo chflags norestricted /usr/local && sudo chown -R $(whoami):admin /usr/local 

If you see permission problems try:

  1. Reboot in recovery mode (hold Cmd + R at boot) and gain access to the terminal.
  2. In this terminal, run: csrutil disable
  3. Reboot back to OS X
  4. Open the Terminal application and run the line at the top
  5. Reboot back into recovery mode and access the terminal again.
  6. In this terminal, run: csrutil enable
  7. Reboot into OS X and you can write to / usr / local & install Homebrew.
+10
Nov 10 '15 at 22:05
source share

For no reason (or at least I would not understand) the repository in /usr/local (which is brew install!) Lost its remote repository. Thus, neither a git reset nor a git pull , and, of course, there will be a brew update .

How do you know that this happened? Check /usr/local/.git/config for lines like:

 [remote "origin"] url = http://github.com/mxcl/homebrew.git fetch = +refs/heads/*:refs/remotes/origin/* 

If you do not do the following:

 cd /usr/local git remote add origin http://github.com/mxcl/homebrew.git git pull origin master 
+5
Nov 16 '12 at 12:05
source share



All Articles