brew install runs for hours and never finishes on macOS
brew install prints nothing new for a very long timeShort 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.
Fix it fast
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 wget2Match what you see, then jump to its fix
- 1
The 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
The 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
With 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
- 1
What does the error look like?
brew install prints nothing new for a very long timeThe install seems to hang at the update step before the package is even namedA 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 HOMEBREW2Fix
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-reset3Verify
brew update finishes and the install that follows starts without a long pause.
brew update && brew install wgetConfirmed by docs.brew.sh
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 -productVersion2Fix
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 wget3Verify
The install finishes in about the time of a download, with no long compile.
brew list wgetConfirmed by docs.brew.sh
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 wget2Fix
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 wget3Verify
The curl output shows a completed transfer, and the install moves on to the next step.
brew list wgetConfirmed by docs.brew.sh
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
Back end
Homebrew: The 'brew link' step did not complete successfully
Error: The 'brew link' step did not complete successfully
brew install puts the files into the Cellar first and then links them into the Homebrew prefix.
4 causes, each with a fixMobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fix