mac下常見軟體源映象
阿新 • • 發佈:2019-02-09
RubyGems
$ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
$ gem sources -l
https://gems.ruby-china.com
# 確保只有 gems.ruby-china.com
Homebrew
摘抄如下
該映象是 Homebrew 的 formula 索引的映象(即 brew update 時所更新內容)。本映象站同時提供 Homebrew 二進位制預編譯包的映象,請參考 Homebrew bottles 映象使用幫助。
替換現有上游
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.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
使用homebrew-science或者homebrew-python
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-science"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-python"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git
brew update
Homebrew-bottles 映象使用幫助
該映象是 Homebrew 二進位制預編譯包的映象。本映象站同時提供 Homebrew 的 formula 索引的映象(即 brew update 時所更新內容),請參考 Homebrew 映象使用幫助。
臨時替換
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
長期替換
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile