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.git

 

切換回官方源:

// 重置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-cask

 

清華源

替換官方源:

// 替換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 時所更新內容)。

參考

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

清華大學開源軟件鏡像站

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM