Error messages

Homebrew fails with “curl: (28)” on Mac

Homebrew downloads with curl. curl exit code 28 is a timeout. The curl documentation says: “The specified time-out period was reached.”

Applies to: Current Homebrew on all current macOS versions.Checked: 29 October 2026

Symptoms

  • brew install stops with curl: (28), then a message that the time ran out.
  • Homebrew says that it failed to download a resource.
  • Downloads fail on a slow network, a VPN or a company network.

Likely causes

  • A slow or lossy connection. Large bottles time out on a weak Wi-Fi or a hotspot.
  • A proxy that curl does not use. Homebrew uses http_proxy, https_proxy and all_proxy.
  • A firewall that drops traffic. A network that drops connections to the download host causes a timeout.
  • A broken IPv6 path. The download host has an IPv6 address, and IPv6 does not work.

How to check

  1. Let Homebrew check your system.

    brew doctor
  2. Test the download host with curl, IPv4 only.

    curl -4 -I https://ghcr.io/v2/
  3. Show the proxy variables.

    env | grep -i proxy
  4. Measure the connection.

    networkQuality

How to fix it

  1. Let Homebrew try more times. The default is 3 retries.

    export HOMEBREW_CURL_RETRIES=5
  2. If the network needs a proxy, set it in the same shell.

    export https_proxy=http://proxy.example.com:8080
  3. If your company has a mirror, set HOMEBREW_BOTTLE_DOMAIN and HOMEBREW_API_DOMAIN.

  4. Run the command again on a faster network, if you can.

With Kilobat

  1. Check if the network is metered, on a VPN or slow.

    kilobat conditions
  2. Kilobat's connection doctor tests the host layer by layer: network, proxy, DNS, rules, IPv4, IPv6, TLS and the server. It names the layer that failed.

    kilobat why https://ghcr.io/v2/
  3. Keep the Mac awake while the install runs.

    kilobat awake -- brew upgrade
  4. These Kilobat checks are free. AI agents run them through MCP with diagnose_connection and diagnose_network. See Find why one site or API won't connect.

Questions

What is curl error 28?

It is CURLE_OPERATION_TIMEDOUT. The curl man page lists exit code 28 as an operation timeout.

Sources

Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.