93566-fr2yws6lfyr.png

此文转自: https://www.cnblogs.com/tp0829/p/Homebrew.html

步骤1.替换Homebrew源

$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

"$(brew --repo)"是用来自动指向Homebrew的目录的.
参考Homebrew源使用帮助.

步骤2.替换homebrew-core源

$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

参考Homebrew Core源使用帮助.

步骤3.替换homebrew-cask源.

$ cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

参考Homebrew Cask源使用帮助.