![speedtest cli 错误:无法连接到服务器来测试延迟](https://linux22.com/image/1190497/speedtest%20cli%20%E9%94%99%E8%AF%AF%EF%BC%9A%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E6%9C%8D%E5%8A%A1%E5%99%A8%E6%9D%A5%E6%B5%8B%E8%AF%95%E5%BB%B6%E8%BF%9F.png)
我成功使用了简单的脚本
$ cat com/speedtestcli
#!/bin/bash
#
# check internet speed
#
#https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3
我也尝试了包装版本
speedtest-cli --secure
在这两种情况下,脚本都会失败并出现以下终端输出:
$ com/speedtestcli
Retrieving speedtest.net configuration...
Testing from YYYYYYY (x.x.x.x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
ERROR: Unable to connect to servers to test latency.
或者
$ speedtest-cli --secure
Retrieving speedtest.net configuration...
Testing from YYYYYYY (x.x.x.x)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
ERROR: Unable to connect to servers to test latency.
考虑到我使用的是 Ububtu 20.04 和 python 3.8.10。速度测试失败的原因是什么?有没有我可以从命令行运行的替代程序?