01 引言02 关闭提示03 替换镜像源
3.1 替换为ustc源3.2 替换为coding源3.3 替换为tsinghua源 04 恢复设置 01 引言
我们如果使用brew命令安装一些插件是,会卡在Updating Homebrew:
那么该如何解决呢?有两种方式:
首先看看关闭提示的方式,直接在控制台输入命令:
vim ~/.bash_profile
并在最后一行增加:
export HOMEBREW_NO_AUTO_UPDATE=true
最后使配置生效:
source ~/.bash_profile
03 替换镜像源 3.1 替换为ustc源cd "$(brew --repo)"git remote set-url origin https://mirrors.ustc.edu.cn/brew.gitbrew updatecd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.gitbrew update
我的本机操作成功了,如下图:
cd "$(brew --repo)"git remote set-url origin https://git.coding.net/homebrew/homebrew.gitbrew update
3.3 替换为tsinghua源cd "$(brew --repo)"git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.gitcd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.gitbrew update
04 恢复设置如果以上设置都不行,则恢复默认设置:
cd "$(brew --repo)"git remote set-url origin https://github.com/Homebrew/brew.gitcd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://github.com/Homebrew/homebrew-core.git