Installing some kind of shadowsocks or v2ray or any other proxy, set socks5 and http protocols.
# if some commands failed may due to a poor network in countries like China
export all_proxy=http://127.0.0.1:PORT_NUMBER
# or
export all_proxy=socks5://127.0.0.1:PORT_NUMBER
# PORT_NUMBER is your shadowsocks settings
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
# no auto-update (***but you'd better not***)
export HOMEBREW_NO_AUTO_UPDATE=true
# 中科大镜像源
cd "$(brew --repo)" && git remote set-url origin <https://mirrors.ustc.edu.cn/brew.git>
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin <https://mirrors.ustc.edu.cn/homebrew-core.git>
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" && git remote set-url origin <https://mirrors.ustc.edu.cn/homebrew-cask.git>
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
brew update
# reset
cd "$(brew --repo)" && git remote set-url origin <https://github.com/Homebrew/brew.git>
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" && git remote set-url origin <https://github.com/Homebrew/homebrew-core.git>
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" && git remote set-url origin <https://github.com/Homebrew/homebrew-cask.git>
# Comment this line:
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx
brew update
brew update
brew doctor
brew gist-logs <formula> # <formula> is the name of the formula that failed
brew config
Oh My Zsh - a delightful & open source framework for Zsh
iTerm2 - macOS Terminal Replacement
Inconsolate for Powerline should be added to Font BookLeft Option (Alt) Key to Esc+;