Mac中安装homebrew

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、清华大学镜像

清华大学homebrew镜像站

3、验证是否成功

复制代码
brew -v

4、参考

Mac 安装 Homebrew

Mac安装Homebrew

相关推荐
pe7er2 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
harmful_sheep5 天前
mac生效的终端查看
macos
iOS门童6 天前
macOS 应用"已损坏"无法打开?一文搞懂 Gatekeeper 与解决方案
macos
NPE~6 天前
[工具分享]Maccy —— 优雅的 macOS 剪贴板历史管理工具
macos·教程·工具·实用工具
差不多程序员6 天前
Mac安装OpenClaw-cn保姆级教程
macos
dzl843946 天前
mac 安装python
开发语言·python·macos
Bruce_Liuxiaowei6 天前
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程
macos·docker·容器·openclaw
阿捏利6 天前
详解Mach-O(十五)Mach-O __DATA_CONST
macos·ios·c/c++·mach-o
ShikiSuen6 天前
macOS 的 CpLk 中英切换卡顿的元凶在 InputMethodKit 本身
macos
xiayutian_c6 天前
如虎添翼-MacOS
macos