Homebrew學習(六)之替換及重置homebrew、Homebred Core、Homebrew cask默認源

替換及重置homebrew默認源

中科大源

替換官方源:

// 替換brew.git:
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

// 替換homebrew-cask.git:
 cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask 

  git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.gitgit

 

切換回官方源:

// 重置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
// 替換homebrew-cask.git:
 cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask  

  git remote set-url origin https://github.com/Homebrew/homebrew-caskgithub

 

清華源url

替換官方源:

// 替換brew.git:
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

// 替換homebrew-core.git:
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew update

切換回官方源:

// 重置brew.git
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

// 重置home-brew-core.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core
brew update

注:該鏡像是 Homebrew 的 formula 索引的鏡像(即 brew update 時所更新內容)。spa

參考

中科大開源鏡像使用幫助列表code

清華大學開源軟件鏡像站orm

相關文章
相關標籤/搜索