I was trying to re-install homebrew on my Mac. I used the following command.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

I got the following error connecting from hotspot and another non-VPN network. Could someone help me with what to do here?

==> Downloading and installing Homebrew...
error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
fatal: expected flush after ref listing
Failed during: /usr/bin/git fetch --force origin

1 Answer 1


Taking your device to a couple other networks would be prudent to be sure it's an issue on your setup with macOS and not just transient network communication issues or a broken proxy / firewall setting on the network side.

This is a better command to test connectivity since it will show errors getting a small handshake with the intended server:

curl -I https://raw.githubusercontent.com/Homebrew/install/master/install.sh

I get the following lines at the end of the output of the command below (and echo $? shows a zero exit status for the curl to get details on the install script)

expires: Thu, 30 Nov 2023 17:23:20 GMT
source-age: 0
content-length: 30633

If your network is behind a firewall (say an entire country or just your connection) there are mirrors and other installation methods to try:

the git mirror section or the untar section would get around blocks of the main git hub communications path that the default install needs to run.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .