Mac brew Updating Homebrew

运行命令brew install node,结果界面一直卡在Updating Homebrew...上,有两种解决办法。
方法一:直接关闭brew每次执行命令时的自动更新(推荐)

vim ~/.bash_profile

# 新增一行
export HOMEBREW_NO_AUTO_UPDATE=true

source ~/.bash_profile

方法二:替换brew源

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

#替换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 update


# 备用地址-1
cd "$(brew --repo)"
git remote set-url origin https://git.coding.net/homebrew/homebrew.git
brew update


# 备用地址-2
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git
brew update

如果备用地址都不行,那就只能再换回官方地址了

#重置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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 曾听说过这样一句话,都说女人容易满足,简单和快乐就足够。 我想这应该算句实话了吧。 女人确实要求比较低,尤其是与男...
    少叔夜阅读 415评论 1 2
  • 起风了,追着风的我将会去往何方。 十年百年千年,那些以为永不会被风化的思念执念,终究不咸不淡化云化烟,稀释淡忘,无...
    伊凌L阅读 141评论 0 1
  • 再次观影《再见前任3》,明白了直觉,女人的直觉! 更明白了放手,原来放手也是一件不容易的事。 “分手”二字很简单,...
    心灵舞者116阅读 214评论 0 0
  • 人微=言轻,人贵=言重。人呀,活的真TM累。
    爱德华奥斯卡洛阅读 193评论 0 0