MacOS 14.3 安装 brew

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

可能出现的问题

问题一
连接超时,报错:

Failed to connect to raw.githubusercontent.com port 443 after 13 ms: Couldn't connect to server

解决方法:

由于某些因素,导致GitHub的raw.githubusercontent.com域名解析错误
打开https://www.ipaddress.com/查询raw.githubusercontent.com的IP地址
修改hosts

sudo vim /etc/hosts

添加如下内容:

199.232.28.133 raw.githubusercontent.com

问题二
连接正常但是找不到页面,报错404: Not Found
解决方法:

打开Homebrew官网:https://brew.sh/zh-cn/ 查看最新地址


问题三
安装时报错

fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75080 ms: Couldn't connect to server Failed during: /usr/bin/git fetch --force origin

解决方法:

确认github是否无法访问
修改hosts

sudo vim /etc/hosts

添加如下内容:

140.82.114.4 github.com

你可能感兴趣的:(MacOS,brew,mac,macos)