macoshomebrewmacos-catalina

Homebrew installer hangs while installing CommandLineTools on macOS Catalina


I'm trying to install Homebrew onto an Intel MacBookPro (macOS Catalina), but while running /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" in Terminal, it seems to hang while installing CommandLineTools (the specific line it hangs on is ==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress).

I already have a full install of Xcode 11 on this machine (which from what I have heard installs Xcode CommandLineTools).

After navigating to /tmp, I found that it did successfully run touch and create the file described in the command it ran, but never wrote anything to it.

I waited for about an hour with no avail. Here is the log:

==> Checking for `sudo` access (which may request your password)...
Password:
==> 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 existing directories will be made group writable:
/usr/local/bin
/usr/local/lib
==> The following existing directories will have their owner set to (redacted for privacy):
/usr/local/bin
/usr/local/lib
==> The following existing directories will have their group set to admin:
/usr/local/bin
/usr/local/lib
==> The following new directories will be created:
/usr/local/etc
/usr/local/include
/usr/local/sbin
/usr/local/share
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort:
==> /usr/bin/sudo /bin/chmod u+rwx /usr/local/bin /usr/local/lib
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/lib
==> /usr/bin/sudo /usr/sbin/chown (redacted for privacy) /usr/local/bin /usr/local/lib
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/lib
==> /usr/bin/sudo /bin/mkdir -p /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod ug=rwx /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod go-w /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown (redacted for privacy) /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew
==> /usr/bin/sudo /usr/sbin/chown -R (redacted for privacy):admin /usr/local/Homebrew
==> /usr/bin/sudo /bin/mkdir -p /Users/(redacted for privacy)/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/(redacted for privacy)/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown -R (redacted for privacy) /Users/(redacted for privacy)/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress


Solution

  • I had the same issue. I tried installing Command Line Tools(CLT) but I got the same finding software dialogue box that never progressed after a minute.

    For me, it turns out that I didn't have Xcode at all and the CLT seems to be dependant on Xcode. I didn't have the Library/developer directory either.

    I downloaded and installed Xcode, I still couldn't use the command line to install CLT tho, I had to download that and install manually as well.

    After getting that all setup homebrew no longer tries to install CLT and is able to complete its install successfully.

    I'm new to Mac and have never used before. I started at a new company and they supplied it and I'm not sure if it was pre-used as it has some apps already installed. Perhaps Xcode got removed or never existed for me. This page explains the whole process in detail for Xcode and CLT https://www.freecodecamp.org/news/how-to-download-and-install-xcode/