安装brew包管理

解决国内下载brew速度慢的问题

  1. 获取 install 文件
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
  1. 编辑brew_install
vim brew_install
  1. 替换BREW_REPO
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
  1. 保存并退出,执行安装
/usr/bin/ruby ~/brew_install
  1. 出现如下代码时,不用等了,直接关掉命令窗口
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
  1. 进入下面的 Taps 目录,clone homebrew-core
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
  1. 把homebrew repo切换为清华镜像
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

brew update
  1. 完成
# Mac 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×