Brew install gets stuck

Hello all, I’ve been trying to install home-brew for the past month spending countless hours trying to find solutions to this problem and I still have no avail.
After running the install command /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" it says it will begin installing, I press enter, and then it basically just freezes. Here is the code exactly how it’s showing:

Analysts-MacBook-Pro:bin yosef.zaverukha$ /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
==> 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…

And then it will just freeze at this point and nothing will happen. I’ve tried uninstalling and it says Failed to locate Homebrew so that isn’t one of the problems. Does anyone have any ideas on how I can fix this, I’m running in circles.

I tried deleting the folders Caskroom, Cellar, Homebrew, and var in my usr/local/ folders and rerun the install script and this time it does this:

Analysts-MacBook-Pro:~ yosef.zaverukha$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> 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
==> The following new directories will be created:
/usr/local/var
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/var /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/var /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown yosef.zaverukha /usr/local/var /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/var /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 116275 (delta 3), reused 3 (delta 0), pack-reused 116253
Receiving objects: 100% (116275/116275), 27.38 MiB | 15.27 MiB/s, done.
Resolving deltas: 100% (84869/84869), done.
From https://github.com/Homebrew/brew
 * [new branch]          master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.12     -> 1.5.12
 * [new tag]             1.5.13     -> 1.5.13
 * [new tag]             1.5.14     -> 1.5.14
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
 * [new tag]             1.6.0      -> 1.6.0
 * [new tag]             1.6.1      -> 1.6.1
 * [new tag]             1.6.10     -> 1.6.10
 * [new tag]             1.6.11     -> 1.6.11
 * [new tag]             1.6.12     -> 1.6.12
 * [new tag]             1.6.13     -> 1.6.13
 * [new tag]             1.6.14     -> 1.6.14
 * [new tag]             1.6.15     -> 1.6.15
 * [new tag]             1.6.16     -> 1.6.16
 * [new tag]             1.6.17     -> 1.6.17
 * [new tag]             1.6.2      -> 1.6.2
 * [new tag]             1.6.3      -> 1.6.3
 * [new tag]             1.6.4      -> 1.6.4
 * [new tag]             1.6.5      -> 1.6.5
 * [new tag]             1.6.6      -> 1.6.6
 * [new tag]             1.6.7      -> 1.6.7
 * [new tag]             1.6.8      -> 1.6.8
 * [new tag]             1.6.9      -> 1.6.9
 * [new tag]             1.7.0      -> 1.7.0
 * [new tag]             1.7.1      -> 1.7.1
 * [new tag]             1.7.2      -> 1.7.2
 * [new tag]             1.7.3      -> 1.7.3
 * [new tag]             1.7.4      -> 1.7.4
 * [new tag]             1.7.5      -> 1.7.5
 * [new tag]             1.7.6      -> 1.7.6
 * [new tag]             1.7.7      -> 1.7.7
 * [new tag]             1.8.0      -> 1.8.0
 * [new tag]             1.8.1      -> 1.8.1
 * [new tag]             1.8.2      -> 1.8.2
 * [new tag]             1.8.3      -> 1.8.3
 * [new tag]             1.8.4      -> 1.8.4
 * [new tag]             1.8.5      -> 1.8.5
 * [new tag]             1.8.6      -> 1.8.6
HEAD is now at 2deacc733 Merge pull request #5467 from MikeMcQuaid/cleanup-runs-prune

At this point again it get’s stuck and nothing changes, cancelling out of it and rerunning the install script gets it stuck at Downloading and installing Homebrew… again like it had happened in my original post.

Could you run ls /usr/local/bin/brew?

Here are the results of doing that:

Analysts-MacBook-Pro:~ yosef.zaverukha$ ls /usr/local/bin/brew

/usr/local/bin/brew

so, it seems to be stuck somewhere after most of the install is completed. If you add /usr/local/bin to your PATH this list of commands should do the rest of the install.

brew update --force

git -C "/usr/local/Homebrew" config --local --replace-all homebrew.analyticsmessage true
git -C "/usr/local/Homebrew" config --local --replace-all homebrew.caskanalyticsmessage true

Some notes you will have missed:

Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics

Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations

Run brew help to get started
Further documentation: https://docs.brew.sh

Good news, it seems like after adding the PATH, many of the features seem to be starting to be fixed. Brew doctor actually gives something back which says that the system is ready to brew and doesn’t say anything else which is good. Trying
to do brew install ffmpeg has the terminal then say ‘Updating homebrew…’ and will then get stuck. Trying to do brew update –force also keeps it hanging so it seems like it doesn’t seem like it wants to update. Happy at least some steps are working now, just
need a little more help to get almost there.

Brew update could take a long time. I guess you can pass brew update --verbose to get an idea if it’s really stuck.

So looks like doing brew update –verbose has it say that homebrew is up to date which is good, it looks like when I actually try doing ‘brew install ffmpeg’ it gets stuck on ‘Updating Homebrew…’ even though brew update said it was up to
date. Here’s the terminal output that I got showing that:

`Analysts-MacBook-Pro:~ yosef.zaverukha$ brew update --verbose

Checking if we need to fetch /usr/local/Homebrew…

Fetching /usr/local/Homebrew…

remote: Enumerating objects: 53, done.

remote: Counting objects: 100% (53/53), done.

remote: Compressing objects: 100% (11/11), done.

remote: Total 60 (delta 39), reused 52 (delta 39), pack-reused 7

Unpacking objects: 100% (60/60), done.

From https://github.com/Homebrew/brew

191a9998a…930f7b90d
master
-> origin/master

Updating /usr/local/Homebrew…

Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.

Reset branch ‘master’

Checking out files: 100% (516/516), done.

Switched to a new branch ‘stable’

Current branch stable is up to date.

Already up-to-date.

Analysts-MacBook-Pro:~ yosef.zaverukha$ brew install ffmpeg --verbose

Updating Homebrew…

^C^CAnalysts-MacBook-Pro:~ yosef.zaverukha$ brew install ffmpeg

Updating Homebrew…

`

So on top of the obvious ones that are already presented in stackoverflow and such, there is also a possibility to run this command
ssh -T git@github.com
And if it returns you this
git@github.com: Permission denied (publickey).
then I recommend you go and create yourself a github account(if you don’t have it) and add your ssh keys there.
Google for: github ssh
if you don’t know how to. Plenty of guides for that
:smiley:

Oh, and quick and dirty one time bypass is to do single ^C, that will cancel the “Brew update” part and life goes on

Updating Homebrew…

I just spent two days trying to fix the same problem. What worked for me was to uninstall Xcode / CLT and reinstall CLT from the apple dev acct choosing the older version. After that the installation went seamlessly.

I had this same issue with macos Catelina, I found it was a security permissions problem. For some reason macos wasn’t prompting me to update my security settings to allow Homebrew to install.

Try going to System Preferences -> Security and Privacy
Then in the Privacy tab allow your terminal (I was using iTerm2 btw) “Full Disk Access” and “Files and Folders”.

For me, after doing that Homebrew installed normally.

2 Likes