macOS 第一次安装 homebrew 

Homebrew — The Missing Package Manager for macOS (or Linux) 

直接使用官方提供的命令:

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

提示:

》〉 /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 27 ms: Couldn't connect to server

解决路径

第一步

查询 raw.githubusercontent.com 的 IP 地址。

https://www.ipaddress.com/

第二步

打开Find , 通过快捷键 command + shift + g 输入

/etc

找到 hosts 文件

并打开。我用 Sublime 编辑器。

在末尾追加:

185.199.108.133 raw.githubusercontent.com

第三步

》〉 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
// 开始安装
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
/etc/paths.d/homebrew
==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Frameworks

Logo

更多推荐