Homebrew-core: Broken install of homebrew. Can't uninstall or reinstall now.

Created on 22 Sep 2016  路  5Comments  路  Source: Homebrew/homebrew-core

Trying to learn Rails via the Lynda course so am completely new to Homebrew.

I copied the following into terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

During this, I was on a train and my wifi must have broke as we went into a tunnel, so I received the following fatal error msg:
==> Downloading and installing Homebrew... fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443: Operation timed out Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1

When I try re-installing, I get the following:
It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" The current contents of /usr/local are bin Cellar etc Frameworks Homebrew include lib opt sbin share var

And when I try uninstalling, I still get no luck:
Failed to locate Homebrew!

Please advise!

Most helpful comment

Ok, let's try to do this somewhat manually:

cd /usr/local/Homebrew
git init
git remote add origin https://github.com/Homebrew/brew
git fetch --all
git checkout -B master origin/master
cd /usr/local
ln -s /usr/local/Homebrew/bin/brew /usr/local/bin

and see if it's working. If not: shout with what failed.

All 5 comments

Ok, let's try to do this somewhat manually:

cd /usr/local/Homebrew
git init
git remote add origin https://github.com/Homebrew/brew
git fetch --all
git checkout -B master origin/master
cd /usr/local
ln -s /usr/local/Homebrew/bin/brew /usr/local/bin

and see if it's working. If not: shout with what failed.

@MikeMcQuaid working perfectly now, thank u!

@MikeMcQuaid You saved my day!!!

I just ran into the same thing because of dumb new-guy mistakes, and these instructions were a lifesaver... THANK YOU!!!!

I fixed this just by force deleting Homebrew directory:

sudo rm -rf /usr/local/Homebrew/

And then I launched installation again.
The reason was that I had no git installed on my system.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakepetroules picture jakepetroules  路  3Comments

oli-laban picture oli-laban  路  3Comments

BluePawDev picture BluePawDev  路  3Comments

dredmorbius picture dredmorbius  路  3Comments

tglawless picture tglawless  路  3Comments