首页 > 系统服务 > 详细

Mac 安装 homebrew 以及报错处理

时间:2019-07-21 14:34:11      阅读:110      评论:0      收藏:0      [点我收藏+]

首先这是homebrew的官网

https://brew.sh/index_zh-cn

安装方法是在终端中输入

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

需要说明的是最好提前在终端中将curl的postBuffer的默认值提高

不然,可能会报如下的错误信息

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

对此的解决方法时

在终端中输入

git config --global http.postBuffer 1048576000 # 这里的数字是字节数 
# 这里给的是 1000MB 也就是1000 * 1024 * 1024
# 可以根据自己的需求更改数值

# 修改完毕后 可以通过以下命令查看postBuffer
git config --list

 

还可能出现以下错误 即提示网速不够 请求被停止了

error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

可以通过以下方法解决:

方法一:更换下载源到国内的清华源

step1:更换仓库源

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

cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

brew update

step2:更换 Homebrew-bottles 镜像(影响软件下载速度)

  临时修改

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

  永久修改

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

 

参考网站

https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

Mac 安装 homebrew 以及报错处理

原文:https://www.cnblogs.com/PowerTips/p/11220931.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!