How to fix Homebrew error "fatal: early EOF"?

Viewed 7240

I'm trying to install Homebrew on MacOS Catalina.

After running the command on their official webpage I'm getting the following error.

==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1.
Failed during: /usr/local/bin/brew update --force
2 Answers

I was having the same problem with the Mac M1 Big Sur.

The comment above was a big help.

Step 1:

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

Step 2:

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

Then it failed.

Step 3:

cd /opt/homebrew/library/taps/homebrew 

Step 4:

sudo rmdir homebrew-core

Step 5:

git clone https://github.com/Homebrew/homebrew-core /opt/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

I also logged into Github on the browser, not sure if that mattered.

I had the same problem. Thankfully, the above answer put me in the right track. I just had to made changes on step 3, 4, and 5.

Step 1

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

Step 2

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

Step 3

/usr/local/Homebrew/Library/Taps/homebrew

Step 4

sudo rm -r homebrew-core

Step 5

git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

Related