Mac brew一直卡在Updating Homebrew

2020-04-20  本文已影响0人  懒人程序猿

方法一

vim ~/.bash_profile
# 新增一行
export HOMEBREW_NO_AUTO_UPDATE=true
#要让刚才的修改马上生效,需要在用户目录下执行以下代码
source .bash_profile
#也可任意位置执行,生效
source ~/.bash_profile

方法二 替换brew源

阿里云

# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 刷新源
brew update

清华

# 替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
# 替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
# 刷新源
brew update
上一篇 下一篇

猜你喜欢

热点阅读