When I try to update (or upgrade brew) I get the following error:
#> brew update
Error:
homebrew-core is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
and when I run the indicated command I get another error:
#> git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
fatal: protocol error: bad pack header
I'm using macOS Big Sur V11.2.3. I have BitDefender as the anti-virus software. I tried disabling it and run the above command but with no luck. Any help would be appreciated.
I found some pages suggesting this was caused by an "anti-virus" software setting enabled by my ISP (Virgin Media in the UK). I turned off "Virus Safe" at https://my.virginmedia.com/my-apps/onlinesecurity/websafe/settings but that didn't fix the issue for me.
Then, I turned on my VPN (NordVPN), and the brew command causing the problem worked.
This happened to me today (also on Virgin Media). An alternative to using a VPN (especially if you don't want to pay for one) is simply to change your chosen DNS servers to a free public one such as Google's as described here. Tldr; set them to one or both of 8.8.4.4
and 8.8.8.8
and the command should work. You can then (if you wish) change back to your router's default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With