I used successfully the simple script
$ 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
An I also tried the package version
speedtest-cli --secure
In both case the scripts fail with this terminal output:
$ 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.
Or
$ 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.
Considering i'm using Ububtu 20.04 and python 3.8.10. There is known reason speedtest fails? There is any alternitive program I can run from command line?