Mac解決homebrew更新慢

參考:Mac OS X 解決HomeBrew更新慢的問題

mac下的brew命令雖然非常好用,但是遇見更新慢時,是很鬧心的一件事。

最簡單的解決辦法就是 替換國內源。

這裏我們使用中科大的源(當然還有很多其它源,可自行搜索),方法如下:

  1. 替換brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
  1. 替換homebrew-core.git和homebrew-cask.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
  1. 執行更新
brew update

清華大學源:

https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

中科大源:

https://mirrors.ustc.edu.cn/brew.git
https://mirrors.ustc.edu.cn/homebrew-core.git
https://mirrors.ustc.edu.cn/homebrew-cask.git
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章