mac使用brew安装程序时报错
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 3 ms: Couldn’t connect to server

解决方式:

# 进入终端执行以下命令
sudo vim /etc/hosts
# 将下列文本追加到hosts文件中
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

设置镜像源
查看 brew.git 当前源

cd "$(brew --repo)" && git remote -v

切换 Homebrew 镜像源为中科大镜像源

cd "$(brew --repo)" && git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

阿里镜像源

cd "$(brew --repo)" && git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

切换 Homebrew 镜像源为清华镜像

cd "$(brew --repo)" && git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐