6

安装Homebrew不要再改hosts了,直接用这个国内源地址更流畅!

 3 years ago
source link: https://blog.didispace.com/homebrew-install-use-chinese-address/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

安装Homebrew不要再改hosts了,直接用这个国内源地址更流畅!

昨天上班莫名机器卡在进度条进不去了,然后重装了系统。无奈之下,一些基础软件要装。作为MacOS用户,Homebrew肯定要先装上的,然后遇到了下面的错误:

% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443

还是比较常规的错误,常规解决方法:

  1. 查询真实IP:在https://www.ipaddress.com/ 查询raw.githubusercontent.com的真实IP。
  2. 修改hosts
sudo vim /etc/hosts

添加如下内容:

199.232.28.133 raw.githubusercontent.com

但这次这招折腾了很久,一直下载到一半就断了。可能最近那个啥又厚了吧…

本来想回家换个网络再试试的,正好群里看到群友推荐使用国内下载源,试了一下非常好用!

下面记录下具体过程,有碰到类似问题的小伙伴可以用下面的方法解决,个人觉得要比改hosts更方便!

具体步骤如下:

  1. 打开终端,输入命令:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

然后如下图操作:

看到下面这样就安装完成了:

输入下面命令打印下版本信息,确认安装成功:

brew -v

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK