# Linux 使用 Speedtest 测速

# Ubuntu

  • 安装
sudo apt-get install gnupg1 apt-transport-https dirmngr
export INSTALL_KEY=379CE192D401AB61
# Ubuntu 支持的版本: xenial, bionic
# Debian 支持的版本: jessie, stretch, buster
export DEB_DISTRO=$(lsb_release -sc)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $INSTALL_KEY
echo "deb https://ookla.bintray.com/debian ${DEB_DISTRO} main" | sudo tee  /etc/apt/sources.list.d/speedtest.list
sudo apt-get update
# 其他非官方二进制文件将与官方冲突
# 可使用以下命令删除
# sudo apt-get remove speedtest-cli
sudo apt-get install speedtest
  • 运行
speedtest

# CentOS

  • 安装
sudo yum install wget
wget https://bintray.com/ookla/rhel/rpm -O bintray-ookla-rhel.repo
sudo mv bintray-ookla-rhel.repo /etc/yum.repos.d/
# Other non-official binaries will conflict with Speedtest CLI
# Example how to remove using yum
# rpm -qa | grep speedtest | xargs -I {} sudo yum -y remove {}
sudo yum install speedtest
  • 运行
speedtest