Mac中安装homeBrew,curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 4 ms: Couldn't connect to server
文章目录
- [Mac中安装homeBrew,curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 4 ms: Couldn't connect to server](#Mac中安装homeBrew,curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 4 ms: Couldn't connect to server)
1、官网安装homebrew
官网地址:homebrew官网
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
如果报错:curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 4 ms: Couldn't connect to server
失败原因:
(1)网络问题:你的计算机可能无法访问外部网络,或者网络请求被防火墙或代理服务器阻止了
(2)DNS污染或解析问题:在某些情况下,DNS服务器可能无法正确解析raw.githubusercontent.com域名,导致连接失败
点击:https://www.ipaddress.com/,查询域名:raw.githubusercontent.com 的真实IP
将其中的一个ip添加到自己电脑中的host文件中
sudo vim /etc/hosts
加入此条:
185.199.111.133 raw.githubusercontent.com
重新执行命令即可
2、清华大学镜像
3、验证是否成功
brew -v