mac安装Homebrew curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75004 ms

mac安装Homebrew,提示如下错误curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75004 ms: Couldn't connect to server,解决办法如下:

第1步 打开host文件

sudo vim /etc/hosts

第2步 添加IP到上述文件中

199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com

第3步 重新安装软件

前往 https://brew.sh/ 复制安装软件的最新脚本
在这里插入图片描述
执行脚本:

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

如图:
在这里插入图片描述
等待安装执行完成…
首次安装可能会出现如下提示

Warning: /opt/homebrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/quanxj/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

在这里插入图片描述
旨意为添加环境变量,此时若再使用,会提示zsh: command not found: brew

第4步 添加环境变量:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/quanxj/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

第5步 验证是否安装成功

brew --version

出现版本信息,即为安装成功
在这里插入图片描述

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值