[scode type="blue"] Homebrew 安装慢,主要是因为默认使用 GitHub 上的官方源,国内网络访问速度受限,可以通过更换为国内镜像源来提速 [/scode] #### 中科大(推荐) ```bash git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc ``` #### 腾讯 ```bash /bin/bash -c "$(curl -fsSL https://mirrors.cloud.tencent.com/homebrewbrew/install/install.sh)" # 装完后Bottles自动指向 https://mirrors.cloud.tencent.com/homebrew-bottles ``` #### 阿里云 ```bash git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc source ~/.zshrc ``` #### 恢复官方源 ```bash git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git unset HOMEBREW_BOTTLE_DOMAIN ``` **PS:** 如果之前装过 homebrew-cask 或 homebrew-services,需要把对应仓库的 remote URL 也改掉 运行 `brew update` 验证速度;若出现 fatal: couldn't find remote ref 可删掉对应目录后 运行`brew tap --force homebrew/core` 重新拉取 Loading... <div class="tip inlineBlock info"> Homebrew 安装慢,主要是因为默认使用 GitHub 上的官方源,国内网络访问速度受限,可以通过更换为国内镜像源来提速 </div> #### 中科大(推荐) ```bash git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc source ~/.zshrc ``` #### 腾讯 ```bash /bin/bash -c "$(curl -fsSL https://mirrors.cloud.tencent.com/homebrewbrew/install/install.sh)" # 装完后Bottles自动指向 https://mirrors.cloud.tencent.com/homebrew-bottles ``` #### 阿里云 ```bash git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc source ~/.zshrc ``` #### 恢复官方源 ```bash git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git unset HOMEBREW_BOTTLE_DOMAIN ``` **PS:** 如果之前装过 homebrew-cask 或 homebrew-services,需要把对应仓库的 remote URL 也改掉 运行 `brew update` 验证速度;若出现 fatal: couldn't find remote ref 可删掉对应目录后 运行`brew tap --force homebrew/core` 重新拉取 Last modification:November 8, 2025 © Allow specification reprint Support Appreciate the author Like 如果觉得我的文章对你有用,请随意赞赏