Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

brew install runs for hours and never finishes on macOS

Errorbrew install prints nothing new for a very long time

Short answer

A brew install that never ends is stuck in one of three places: the automatic update that runs before it, a compile because no ready-made bottle fits your macOS, or a download that stalls on the network. Look at the last thing the terminal printed, then use the setting that matches.

  • Applies to Homebrew (current docs), macOS 15, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run the install again with the auto-update switched off and curl output switched on. If it now starts at once, the update was the stall. If it compiles, read the Mac's version. If it downloads and stops, it is the network.

    sw_vers -productVersion
    HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_CURL_VERBOSE=1 brew install wget
  2. 2Match what you see, then jump to its fix

    1. 1The terminal sits at the update step, and with HOMEBREW_NO_AUTO_UPDATE=1 the same install starts straight awayThe automatic update before the install is slow or stuckFix
    2. 2The terminal prints compiler or build output instead of a quick download, and sw_vers shows a macOS older than 15No ready-made bottle fits your macOS, so Homebrew compiles from sourceFix
    3. 3With HOMEBREW_CURL_VERBOSE=1 the curl output shows a connection that never completes, or a transfer that stops at a fixed pointThe download stalls: a proxy, a firewall or a slow route to the bottle serverFix

What does the error look like?

  • brew install prints nothing new for a very long time
  • The install seems to hang at the update step before the package is even named
  • A formula that normally installs in minutes takes hours

Cause 1 of 3

The automatic update before the install is slow or stuck

1Check

Homebrew runs brew update before some commands, such as brew install, once every 24 hours by default. The interval drops to one hour after you have run a developer command, and to five minutes if HOMEBREW_NO_INSTALL_FROM_API is set.

env | grep HOMEBREW

2Fix

Skip the automatic update for this install and run the update on its own. If the update itself hangs on a broken checkout, brew update-reset fetches and resets Homebrew and its taps to their latest origin/HEAD. It destroys local changes in those repositories.

HOMEBREW_NO_AUTO_UPDATE=1 brew install wget
brew update
# only if update itself hangs or fails:
brew update-reset

3Verify

brew update finishes and the install that follows starts without a long pause.

brew update && brew install wget

Confirmed by docs.brew.sh

Did this fix it?

Cause 2 of 3

No ready-made bottle fits your macOS, so Homebrew compiles from source

1Check

Bottles are prebuilt binaries, and Homebrew installs from one unless none exists for the running macOS version or --build-from-source was given. Homebrew supports macOS 15 and later; macOS 11 to 14 are unsupported but may work, and an Intel Mac is a Tier 3 configuration. Building from source needs Xcode or the Command Line Tools.

sw_vers -productVersion

2Fix

The lasting fix is a supported macOS version. For one install, ask for a bottle explicitly: --force-bottle installs from a bottle for the current or the newest macOS version even when Homebrew would not normally choose it.

brew install --force-bottle wget

3Verify

The install finishes in about the time of a download, with no long compile.

brew list wget

Confirmed by docs.brew.sh

Did this fix it?

Cause 3 of 3

The download stalls: a proxy, a firewall or a slow route to the bottle server

1Check

Homebrew downloads bottles with curl. HOMEBREW_CURL_VERBOSE passes --verbose to curl, so the connection attempts are visible. By default curl is retried 3 times (HOMEBREW_CURL_RETRIES).

HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_CURL_VERBOSE=1 brew install wget

2Fix

On a network that needs a proxy, set the proxy variables Homebrew passes to curl, git and svn. If a mirror is allowed, HOMEBREW_BOTTLE_DOMAIN points bottle downloads at it.

export https_proxy=http://proxy.example.com:3128
export all_proxy=socks5://proxy.example.com:1080
brew install wget

3Verify

The curl output shows a completed transfer, and the install moves on to the next step.

brew list wget

Confirmed by docs.brew.sh

Did this fix it?

How do I stop it coming back?

  • Keep macOS on a version Homebrew supports; older versions can force slow source builds.
  • Set HOMEBREW_AUTO_UPDATE_SECS to a larger number if you do not want an update before every install.
  • Do not export HOMEBREW_NO_INSTALL_FROM_API in your shell profile unless you need it: it shortens the update interval to five minutes.
  • Run brew doctor when something looks wrong; it exits with a non-zero status if it finds a problem.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.