homebrew 安装踩坑解决过程

匿名 (未验证) 提交于 2019-12-02 23:47:01

Homebrew

由于国外镜像不FQ的安装的话基本就会被qiang,所以按照官网的方式去安装会有error: RPC failed的错误;

可以将安装的文件下载到本地,通过修改国内源去安装;

下载源到本地

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

修改镜像源

BREW_REPO = "https://github.com/Homebrew/brew".freeze

修改为(如果没有找到的CORE_TAP_REPO的话直接复制)

BREW_REPO = "https://mirrors.ustc.edu.cn/brew.git".freeze CORE_TAP_REPO = "https://mirrors.ustc.edu.cn/homebrew-core.git".freeze

通过脚本安装brew

直接在控制台输入

/usr/bin/ruby brew_install

这里用的是中科院的源,可能会出现

fatal: early EOF fatal: index-pack failed Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1` exited with 128. Error: Failure while executing; `/usr/local/bin/brew tap homebrew/core` exited with 1. Failed during: /usr/local/bin/brew update --force

需要执行git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

homebrew-core的镜像地址也设为中科院的国内镜像

cd "$(brew --repo)"   git remote set-url origin https://mirrors.ustc.edu.cn/brew.git  cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"   git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git  // 更新 brew update
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!