Mac 安装 Dart 环境一直 显示 Updateing Homebrew...

Mac通过命令安装 Dart,一直卡住不动,如下

jason@local homebrew-core$ brew tap dart-lang/dart
Updating Homebrew...

解决方案

网上资料都是说改下.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

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

安装 dart

jason@local Homebrew$ brew install dart --devel
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Installing dart from dart-lang/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/dev/release
######################################################################## 100.0%
==> Caveats
Please note the path to the Dart SDK:
  /usr/local/opt/dart/libexec
==> Summary
  /usr/local/Cellar/dart/2.6.0-dev.8.1: 474 files, 474.0MB, built in 1 minute 32 seconds

安装完毕后,可以选择切换回官方源

# 第一步:重置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

#第三步:注释掉bash配置文件里的有关Homebrew Bottles即可恢复官方源。 重启bash或让bash重读配置文件

你可能感兴趣的:(Mac 安装 Dart 环境一直 显示 Updateing Homebrew...)