更換 homebrew 國內鏡像源


Brew 是OS X 上類似apt-get以及yum的一個軟件包管理器,它依托於Github………………

所以,雖然你僥幸下載到了 brew,但你肯定是無法更新 brew 的。原因你懂。不過雖然不能更新 brew,但這只是指brew這個管理器本身罷了,軟件還是可以安裝的。但由於無法使用 brew update 也就無法更新軟件……我們有必要來給 brew 換源。

 

安裝、卸載homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
sudo rm -rf /usr/local/

替換homebrew默認源

cd /usr/local
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git

替換homebrew-core默認源

cd /usr/local/Library/Taps/homebrew/homebrew-core
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git

替換homebrew-cask默認源

cd /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-cask.git

替換homebrew bottles默認源

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bashrc
sourch ~/.bashrc

 

PS:

https://servers.ustclug.org/2016/01/mirrors-add-homebrew-bottles-source/

https://www.logcg.com/archives/1301.html

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew-bottles/

https://lug.ustc.edu.cn/wiki/mirrors/help/homebrew-bottles

 


免責聲明!

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



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