美文网首页
homebrew 快速安装

homebrew 快速安装

作者: lyleyang | 来源:发表于2020-08-16 08:13 被阅读0次

官方的安装方式是

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

但是速度很慢,推荐使用清华镜像安装

下载安装脚本

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh >> install.sh

替换为镜像

替换 install.sh 脚本中BREW_REPO为镜像地址

BREW_REPO="https://github.com/Homebrew/brew"
#替换为
BREW_REPO="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"

安装

./install.sh

然后会卡在

Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...

直接Ctrl-C结束,这个时候还没有安装好,需要手动clone homebrew-core

mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/
cd /usr/local/Homebrew/Library/Taps/homebrew
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

安装就完成了,但是安装程序还是慢,需要把二进制文件仓库也替换

替换二进制为镜像

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles

相关文章

网友评论

      本文标题:homebrew 快速安装

      本文链接:https://www.haomeiwen.com/subject/nkwurktx.html