我无法在新安装的Ubuntu服务器上的命令行中使用github。击打和冰壶github失败,但对其他主机工作良好。
OS:Ubuntu 22.04.1 LTS
# google works fine
ping -c3 google.com
...
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
# github fails - each ping attempt results in 'Destination Host Unreachable'
ping -c3 github.com
...
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2051ms# google works fine
curl -s --head --request GET google.com > /dev/null; echo $?
0
# github fails
curl -s --head --request GET github.com > /dev/null; echo $?
7# fails with 'no route to host'
git clone https://github.com/pi-hole/pi-hole.git
Cloning into 'pi-hole'...
fatal: unable to access 'https://github.com/pi-hole/pi-hole.git/': Failed to connect to github.com port 443 after 18534 ms: No route to host据我所知,我没有处理任何代理或异常防火墙设置。
谢谢你的建议。
发布于 2023-05-16 13:32:58
我重新安装了Ubuntu 22.04.1 LTS,并遇到了同样的问题。
原来我的IP4网关没有设置,nmcli d show | grep IP4.GATEWAY产生了“--”结果。
我已经用sudo ip route add default via 192.168.X.Y设置好了,然后我就可以成功克隆了。
我希望这有帮助:)
https://unix.stackexchange.com/questions/721145
复制相似问题