Preface, being a programmer in China has inherent disadvantages, which are mainly divided into language and network environment.

Brew Update is a really slow batch

Today, I have the honor to share how to speed up the takeoff of Homebrew on the computer

1. Modify the source mirror

I use tsinghua University mirror station

1.1 replace

git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git  brew updateCopy the code

1.2 Restore (if you still prefer github updates)

git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git git -C "$(brew --repo homebrew/core)"  remote set-url origin https://github.com/Homebrew/homebrew-core.git git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git brew updateCopy the code

2. Modify the bottles

Open the shell configuration file you are using, for example:.zshrc

Add the following variables at the right place in the file (whatever you like)

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
Copy the code

3. The completion of the

Try againbrew updateIs not a bike to a motorcycle