Homebrew 中科大源

Install Homebrew or Switch to USTC source

Add the following to your shell’s environment path.

For instance, if you use bash, append to the ~/.bashrc. If you use zsh, append to ~/.zshrc.

1
2
3
4
export HOMEBREW_NO_AUTO_UPDATE=true
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"

Then run the homebrew install script. (If you have already installed and only needs to change the source, just skip the following line)

1
/bin/bash -c "$(curl -fsSL https://github.com/Homebrew/install/raw/HEAD/install.sh)"

After that, restart your terminal or execute the following to reload the environment.

1
exec zsh

And then

1
2
brew update
brew upgrade

The first time brew update might take a bit long time since it needs to download all the package list data. Be patient. The speed will become fast once the initial brew update is complete.


Homebrew 中科大源
https://www.billhu.us/2022/15_brew_ustc/
Author
Bill Hu
Posted on
February 8, 2022
Licensed under