Mac下更換Homebrew鏡像源的實現(xiàn)方法
1.使用中科大源
(1)替換默認源
第一步:替換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)的一款開源的包管理器。出于節(jié)省時間的考慮,Homebrew默認從Homebrew Bottles源中下載二進制代碼包安裝。Homebrew Bottles是Homebrew提供的二進制代碼包,目前鏡像站收錄了以下倉庫:
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
對于bash用戶:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
對于zsh用戶
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc
2.使用清華源
(1)替換默認源
第一步:替換現(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或者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 cd brew update
(2)替換Homebrew Bottles源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile source ~/.bash_profile
3.在中科大源或清華源失效或宕機時可以切換回官方源
第一步:重置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即可恢復官方源。 重啟bash或讓bash重讀配置文件。
到此這篇關(guān)于Mac下更換Homebrew鏡像源的實現(xiàn)方法的文章就介紹到這了,更多相關(guān)Mac更換Homebrew鏡像源內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
聯(lián)邦學習論文解讀分散數(shù)據(jù)的深層網(wǎng)絡通信
這篇文章主要為大家介紹了論文解讀分散數(shù)據(jù)的深層網(wǎng)絡通信有效學習,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-05-05Git的基本操作流程及工作區(qū)版本庫暫存區(qū)的關(guān)系
這篇文章主要為大家介紹了Git的基本操作流程及工作區(qū)版本庫暫存區(qū)的關(guān)系,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-04-04win10 + anaconda3 + python3.6 安裝tensorflow + keras的步驟詳解
這篇文章主要介紹了win10 + anaconda3 + python3.6 安裝tensorflow + keras的步驟,需要的朋友可以參考下2019-09-09