安裝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
在這裏插入圖片描述
開啓科學上網後訪問:
在這裏插入圖片描述
這說明raw.githubusercontent.com這個站點是被牆的。

在開啓科學上網的情況下,我將要下載的文件: https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh,copy & paste進一個XX.sh文件(記得給XX.sh加可執行權限), 然後執行XX.sh。

成功執行腳本!!on my zsh成功安裝!!
在這裏插入圖片描述
以上

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章