安装oh my zsh失败:curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

1 遇到的问题

我需要在macOS系统上安装OhMyZsh。
根据oh my zsh的README,我的环境满足它的所有Prerequisites

根据文档,运行命令:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

报错:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

执行另一条命令:

sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

报错:

正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)… 0.0.0.0
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|0.0.0.0|:443… 失败:Connection refused。

显然,问题是机器连不上raw.githubusercontent.com这个站点的443端口,443端口是用于HTTP服务的。

2 解决方案

查了github上的相关issue, 找到了解决方案:https://github.com/ohmyzsh/ohmyzsh/issues/8515

其中有一条评论是这么说的:

If this turns out to be a Great Firewall of China issue, I stronly advise against using an unknown site instead, especially if you want to download things that you’re going to run later, as is the case.

Instead, given that you can visit github.com, try downloading the ZIP of the repository (press the “Clone or download” button, then “Download ZIP”). Or you can try to git-clone the repository. You can also access the web UI of the install script and copy-paste the contents of it into an install.sh script and run that.

根据评论,我在不开启科学上网的情况下,访问https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
在这里插入图片描述
开启科学上网后访问https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
在这里插入图片描述
这说明raw.githubusercontent.com这个站点是被墙的。

在开启科学上网的情况下,我将要下载的文件: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh,copy & paste进一个XX.sh文件(记得给XX.sh加可执行权限), 然后执行XX.sh。

成功执行脚本!!on my zsh成功安装!!
在这里插入图片描述
以上

评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值