一行命令解决Mac无法安装brew,报curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused错误
绝望之际,无意中看到一个大佬放上一条命令,直接解决了这一系列问题,可以下载。很感谢这位大佬,不多说直接上命令:
自动脚本(全部国内地址)(在Mac os终端中复制粘贴回车下面这句话)
/bin/zsh -c "$(curl -fsSL
https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
以下是安装成功的效果:
[mac]~ % /bin/zsh -c "$(curl -fsSL
以下是安装成功的效果:
[mac]~ % /bin/zsh -c "$(curl -fsSL
https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
开始执行Brew自动安装程序
请选择一个下载镜像,例如中科大,输入1回车。
源有时候不稳定,如果git克隆报错重新运行脚本选择源。cask非必须,有部分人需要。
1、中科大下载源 2、清华大学下载源 3、北京外国语大学下载源 4、腾讯下载源(不显示下载进度) 5、阿里巴巴下载源(缺少cask源)
请输入序号: 2
你选择了清华大学下载源
!!!此脚本将要删除之前的brew(包括它下载的软件),请自行备份。
->是否现在开始执行脚本(N/Y)y
--> 脚本开始执行
==> 通过命令删除之前的brew、创建一个新的Homebrew文件夹
(设置开机密码:在左上角苹果图标->系统偏好设置->"用户与群组"->更改密码)
(如果提示This incident will be reported. 在"用户与群组"中查看是否管理员)
请输入开机密码,输入过程不显示,输入完后回车
Password:
开始执行
-> 创建文件夹 /usr/local/Homebrew
此步骤成功
-> 创建文件夹 /usr/local/Caskroom
此步骤成功
-> 创建文件夹 /usr/local/Cellar
此步骤成功
-> 创建文件夹 /usr/local/var/homebrew
此步骤成功
-> 创建文件夹 /usr/local/etc
此步骤成功
-> 创建文件夹 /usr/local/opt
此步骤成功
-> 创建文件夹 /usr/local/share/zsh
此步骤成功
-> 创建文件夹 /usr/local/share/zsh/site-functions
此步骤成功
-> 创建文件夹 /usr/local/var/homebrew/linked
此步骤成功
-> 创建文件夹 /usr/local/Frameworks
此步骤成功
git version 2.24.3 (Apple Git-128)
下载速度觉得慢可以ctrl+c或control+c重新运行脚本选择下载源
==> 克隆Homebrew基本文件(32M+)
未发现Git代理(属于正常状态)
Cloning into '/usr/local/Homebrew'...
remote: Counting objects: 152556, done.
remote: Compressing objects: 100% (40225/40225), done.
remote: Total 152556 (delta 112752), reused 147586 (delta 108855)
Receiving objects: 100% (152556/152556), 37.81 MiB | 5.90 MiB/s, done.
Resolving deltas: 100% (112752/112752), done.
此步骤成功
==> 创建brew的替身
此步骤成功
==> 克隆Homebrew Core(224M+)
此处如果显示Password表示需要再次输入开机密码,输入完后回车
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 789890, done.
remote: Compressing objects: 100% (276858/276858), done.
Receiving objects: 100% (789890/789890), 247.57 MiB | 4.71 MiB/s, done.
remote: Total 789890 (delta 526404), reused 768188 (delta 509958)
Resolving deltas: 100% (526404/526404), done.
Updating files: 100% (5467/5467), done.
此步骤成功
==> 克隆Homebrew Cask(248M+) 类似AppStore
此处如果显示Password表示需要再次输入开机密码,输入完后回车
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Counting objects: 476228, done.
remote: Compressing objects: 100% (143069/143069), done.
remote: Total 476228 (delta 338452), reused 469345 (delta 332597)
Receiving objects: 100% (476228/476228), 208.04 MiB | 3.59 MiB/s, done.
Resolving deltas: 100% (338452/338452), done.
此步骤成功
==> 配置国内镜像源HOMEBREW BOTTLE
此步骤成功
==> 安装完成,brew版本
10.15
brew -v
Homebrew 2.4.16-180-gb2d9594-dirty
Homebrew/homebrew-core (git revision 44470; last commit 2020-09-06)
Homebrew/homebrew-cask (git revision 06c188; last commit 2020-09-06)
Brew前期配置成功
==> brew update
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics have been recorded yet (or will be during this `brew` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
Already up-to-date.
上一句如果提示Already up-to-date表示成功
Brew自动安装程序运行完成
国内地址已经配置完成
初步介绍几个brew命令
本地软件库列表:brew ls
查找软件:brew search google(其中google替换为要查找的软件关键字)
查看brew版本:brew -v 更新brew版本:brew update
现在可以输入命令open ~/.zshrc -e 或者 open ~/.bash_profile -e 整理一下重复的语句(运行 echo $SHELL 可以查看应该打开那一个文件修改)
开始执行Brew自动安装程序
请选择一个下载镜像,例如中科大,输入1回车。
源有时候不稳定,如果git克隆报错重新运行脚本选择源。cask非必须,有部分人需要。
1、中科大下载源 2、清华大学下载源 3、北京外国语大学下载源 4、腾讯下载源(不显示下载进度) 5、阿里巴巴下载源(缺少cask源)
请输入序号: 2
你选择了清华大学下载源
!!!此脚本将要删除之前的brew(包括它下载的软件),请自行备份。
->是否现在开始执行脚本(N/Y)y
--> 脚本开始执行
==> 通过命令删除之前的brew、创建一个新的Homebrew文件夹
(设置开机密码:在左上角苹果图标->系统偏好设置->"用户与群组"->更改密码)
(如果提示This incident will be reported. 在"用户与群组"中查看是否管理员)
请输入开机密码,输入过程不显示,输入完后回车
Password:
开始执行
-> 创建文件夹 /usr/local/Homebrew
此步骤成功
-> 创建文件夹 /usr/local/Caskroom
此步骤成功
-> 创建文件夹 /usr/local/Cellar
此步骤成功
-> 创建文件夹 /usr/local/var/homebrew
此步骤成功
-> 创建文件夹 /usr/local/etc
此步骤成功
-> 创建文件夹 /usr/local/opt
此步骤成功
-> 创建文件夹 /usr/local/share/zsh
此步骤成功
-> 创建文件夹 /usr/local/share/zsh/site-functions
此步骤成功
-> 创建文件夹 /usr/local/var/homebrew/linked
此步骤成功
-> 创建文件夹 /usr/local/Frameworks
此步骤成功
git version 2.24.3 (Apple Git-128)
下载速度觉得慢可以ctrl+c或control+c重新运行脚本选择下载源
==> 克隆Homebrew基本文件(32M+)
未发现Git代理(属于正常状态)
Cloning into '/usr/local/Homebrew'...
remote: Counting objects: 152556, done.
remote: Compressing objects: 100% (40225/40225), done.
remote: Total 152556 (delta 112752), reused 147586 (delta 108855)
Receiving objects: 100% (152556/152556), 37.81 MiB | 5.90 MiB/s, done.
Resolving deltas: 100% (112752/112752), done.
此步骤成功
==> 创建brew的替身
此步骤成功
==> 克隆Homebrew Core(224M+)
此处如果显示Password表示需要再次输入开机密码,输入完后回车
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 789890, done.
remote: Compressing objects: 100% (276858/276858), done.
Receiving objects: 100% (789890/789890), 247.57 MiB | 4.71 MiB/s, done.
remote: Total 789890 (delta 526404), reused 768188 (delta 509958)
Resolving deltas: 100% (526404/526404), done.
Updating files: 100% (5467/5467), done.
此步骤成功
==> 克隆Homebrew Cask(248M+) 类似AppStore
此处如果显示Password表示需要再次输入开机密码,输入完后回车
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Counting objects: 476228, done.
remote: Compressing objects: 100% (143069/143069), done.
remote: Total 476228 (delta 338452), reused 469345 (delta 332597)
Receiving objects: 100% (476228/476228), 208.04 MiB | 3.59 MiB/s, done.
Resolving deltas: 100% (338452/338452), done.
此步骤成功
==> 配置国内镜像源HOMEBREW BOTTLE
此步骤成功
==> 安装完成,brew版本
10.15
brew -v
Homebrew 2.4.16-180-gb2d9594-dirty
Homebrew/homebrew-core (git revision 44470; last commit 2020-09-06)
Homebrew/homebrew-cask (git revision 06c188; last commit 2020-09-06)
Brew前期配置成功
==> brew update
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics have been recorded yet (or will be during this `brew` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
Already up-to-date.
上一句如果提示Already up-to-date表示成功
Brew自动安装程序运行完成
国内地址已经配置完成
初步介绍几个brew命令
本地软件库列表:brew ls
查找软件:brew search google(其中google替换为要查找的软件关键字)
查看brew版本:brew -v 更新brew版本:brew update
现在可以输入命令open ~/.zshrc -e 或者 open ~/.bash_profile -e 整理一下重复的语句(运行 echo $SHELL 可以查看应该打开那一个文件修改)