Press "Enter" to skip to content

brew install XXX一直卡在Updating Homebrew…的解决办法

替换brew源:

## 第一步:替换brew.git:
$ cd "$(brew --repo)"

/* 以下的源挑一即可 */
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git //中科大
$ git remote set-url origin https://git.coding.net/homebrew/homebrew.git //coding


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

重置brew源(恢复默认源)

如果想要恢复到初始的brew源,可以用以下办法:

## 第一步:重置brew.git:
$ cd "$(brew --repo)"
$ git remote set-url origin https://github.com/Homebrew/brew.git


## 第二步:重置homebrew-core.git:
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://github.com/Homebrew/homebrew-core.git
发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注