问题如题所示,具体现象如下:

(base) adamhuan@adamhuandeMacBook-Pro iTerm % 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 after 7 ms: Connection refused
(base) adamhuan@adamhuandeMacBook-Pro iTerm %

解决方法:

通过下列网站找寻正确的IP地址:
https://ipaddress.com/website/raw.githubusercontent.com

在这个网页上,你会得到这样的查询结果:

在上面结果的【DNS Resource Records】中随便选取一个IP地址

然后编辑操作系统的HOSTS表信息:

在Apple MacOS与Linux中,HOSTS表文件位于【/etc/hosts】

(base) adamhuan@adamhuandeMacBook-Pro iTerm % sudo su -
Password:
adamhuandeMacBook-Pro:~ root#
adamhuandeMacBook-Pro:~ root# cat /etc/hosts
##
# Host Database
#
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost

# MacWk.com Hosts Start
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost

# MacWk.com Hosts Start

# DaisyDisk
127.0.0.1 daisydiskapp.com

# HoudahSpot
127.0.0.1 dl.houdah.com
127.0.0.1 www.houdah.com

# Sublime Merge
127.0.0.1 www.sublimemerge.com
127.0.0.1 sublimemerge.com
127.0.0.1 license.sublimehq.com

# MacWk.com Hosts End
adamhuandeMacBook-Pro:~ root#
adamhuandeMacBook-Pro:~ root# vi /etc/hosts
adamhuandeMacBook-Pro:~ root#
adamhuandeMacBook-Pro:~ root# cat /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost

# MacWk.com Hosts Start

# DaisyDisk
127.0.0.1 daisydiskapp.com

# HoudahSpot
127.0.0.1 dl.houdah.com
127.0.0.1 www.houdah.com

# Sublime Merge
127.0.0.1 www.sublimemerge.com
127.0.0.1 sublimemerge.com
127.0.0.1 license.sublimehq.com

# MacWk.com Hosts End

# Github.com
185.199.108.133 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com

# Finished

adamhuandeMacBook-Pro:~ root#

可以看到,添加了一段【# Github.com】的定义。

然后,再试试之前的出问题的命令:

可以看到,已经没有问题了。


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

隐藏
变装