Mac 記錄之 Homebrew換源
問題
國內環境使用Homebrew安裝軟體很慢或者說卡死在Updating homebrew步驟,如下:
Updating Homebrew .. #速度很慢或者說卡死
方法
更新三個關鍵倉庫地址為Alibaba提供的地址
- brew.git
- homebrew-core.git
- homebrew-bottles
brew.git 替換/還原
# 替換成阿里巴巴的 brew.git 倉庫地址:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
#=======================================================
# 還原為官方提供的 brew.git 倉庫地址
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
homebrew-core.git 替換/還原
# 替換成阿里巴巴的 homebrew-core.git 倉庫地址:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.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-bottles 替換/還原
根據裝置macOS當前使用的shell版本決定使用哪種方式
echo $SHELL
# 如果你的輸出結果是 /bin/zsh,參考?的 zsh 終端操作方式
# 如果你的輸出結果是 /bin/bash,參考?的 bash 終端操作方式
- zsh 終端操作
# 替換成阿里巴巴的 homebrew-bottles 訪問地址:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
#=======================================================
# 還原為官方提供的 homebrew-bottles 訪問地址
vi ~/.zshrc
# 然後,刪除 HOMEBREW_BOTTLE_DOMAIN 這一行配置
source ~/.zshrc
- bash 終端操作
# 替換 homebrew-bottles 訪問 URL:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
#=======================================================
# 還原為官方提供的 homebrew-bottles 訪問地址
vi ~/.bash_profile
# 然後,刪除 HOMEBREW_BOTTLE_DOMAIN 這一行配置
source ~/.bash_profile
相關文章
- Mac下更換Homebrew映象源的實現方法Mac
- Homebrew 換源安裝與使用
- Mac-Homebrew 安裝/解除安裝/更換國內映象源Mac
- 記錄Mac Pro M1晶片安裝HomeBrew的過程吧Mac晶片
- mac 按照 homebrewMac
- Mac安裝HomebrewMac
- Mac HomeBrew上手教程Mac
- 更換Ubuntu源為國內源的操作記錄Ubuntu
- Mac利器Homebrew介紹Mac
- mac下安裝homebrewMac
- Mac 系統 Homebrew 工具Mac
- Mac OS下用Homebrew安裝自己寫的開源工具Mac開源工具
- MAC: Homebrew(代替yum)安裝Mac
- Mac使用記錄Mac
- M1 Mac安裝 HomebrewMac
- Mac 下使用homebrew安裝NVMMac
- MAC上Homebrew常用命令Mac
- mac簡單設定(一)--homebrewMac
- mac 安裝opencv homebrew安裝MacOpenCV
- Linux下更換預設yum源為網易yum源的操作記錄Linux
- Mac OS 下更換 Ruby 源Mac
- Mac下通過Homebrew安裝MySQLMacMySql
- Mac安裝homebrew證書過期Mac
- Homebrew- MAC上的包管理利器Mac
- MAC 終端 命令 記錄Mac
- Mac | 技巧點滴記錄Mac
- Oracle之記錄Oracle
- 記錄一個行列轉換
- M1 Mac 12.1 Homebrew安裝GoMacGo
- 蘋果M1 Mac上怎樣使用Homebrew?蘋果Mac
- Mac下Charles踩坑記錄Mac
- 開發:隨筆記錄之 新老父子級關係替換筆記
- 部落格域名更換操作記錄
- MySQL 主備庫切換記錄MySql
- 什麼是Homebrew和在Mac上的怎麼使用?Mac
- 開發:隨筆記錄之 Json字串和物件的相互轉換筆記JSON字串物件
- MAC上Flutter環境搭建記錄MacFlutter
- 記錄Mac下使用Charles抓包Mac