TIL: when Homebrew cannot install package

Newsletter Apr 25, 2022
➜  ~ brew install libpng

==> Downloading https://ghcr.io/v2/homebrew/core/libpng/manifests/1.6.37

if it hangs for more than 30 seconds, may be because the mirror is not working. We try to change to another mirrors in below list.

https://mirrors.sustech.edu.cn/homebrew-bottles/bottles
https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles

If you use it temporarily, export it to the environment right in the session you are using

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.sustech.edu.cn/homebrew-bottles/bottles

Or make a permanent change in environment

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.sustech.edu.cn/homebrew-bottles/bottles' >> ~/.bash_profile

Tags