(1)替換默認(rèn)源
第一步:替換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 cd brew update
(2)替換Homebrew Bottles源
Homebrew是OS X系統(tǒng)的一款開(kāi)源的包管理器。出于節(jié)省時(shí)間的考慮,Homebrew默認(rèn)從Homebrew Bottles源中下載二進(jìn)制代碼包安裝。Homebrew Bottles是Homebrew提供的二進(jìn)制代碼包,目前鏡像站收錄了以下倉(cāng)庫(kù):
homebrew/homebrew-core homebrew/homebrew-dupes homebrew/homebrew-games homebrew/homebrew-gui homebrew/homebrew-python homebrew/homebrew-php homebrew/homebrew-science homebrew/homebrew-versions homebrew/homebrew-x11
對(duì)于bash用戶:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
對(duì)于zsh用戶
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc
(1)替換默認(rèn)源
第一步:替換現(xiàn)有上游
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 cd brew update
第二步:使用homebrew-science或者h(yuǎn)omebrew-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 cd brew update
(2)替換Homebrew Bottles源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
第一步:重置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 cd brew update
第三步:注釋掉bash配置文件里的有關(guān)Homebrew Bottles即可恢復(fù)官方源。 重啟bash或讓bash重讀配置文件。
到此這篇關(guān)于Mac下更換Homebrew鏡像源的實(shí)現(xiàn)方法的文章就介紹到這了,更多相關(guān)Mac更換Homebrew鏡像源內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
標(biāo)簽:紅河 沈陽(yáng) 無(wú)錫 青海 阜陽(yáng) 河源 哈密 忻州
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Mac下更換Homebrew鏡像源的實(shí)現(xiàn)方法》,本文關(guān)鍵詞 Mac,下,更換,Homebrew,鏡像,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。