Fix Homebrew update freezing on MacOS

I recently had a problem with Homebrew on my Mac. When I tried to install something, for example brew install docker it will freeze on the command Running brew update --preinstall. Apparently there is a way to debug what happens by running brew update -d which will output the log of the update command. On my Mac it will block on rm -f /opt/homebrew/.git/TMP_FETCH_FAILURE (that is for M1 Mac, on Intel the path may be different).
Read more →