Introduction:
Speedtest is a very useful utility for testing your Internet speed in real-time. However, while working with Linux based systems, most of the users prefer such tools that can be used via the terminal. Therefore, the Speedtest utility also comes in a CLI version that can conveniently be used with the Linux terminal. Today, we will be installing and using the Speedtest CLI to test our Internet speed on Ubuntu 20.04.
Method of Installing and Using the Speedtest CLI for Testing the Internet Speed on Ubuntu 20.04:
For installing and using the Speedtest CLI for testing the Internet speed on your Ubuntu 20.04 system, you have to perform the following steps:
Step # 1: Update your Ubuntu 20.04 System:
Since we will be installing some new packages in the upcoming steps, therefore, it is highly advisable that we update our system first with the command shown below:
sudo apt update
Once your Ubuntu 20.04 system is fully updated, its terminal will look something like this:
Step # 2: Install Python on Ubuntu 20.04 System:
Now, we need to install Python on our Ubuntu 20.04 system. This step is mandatory for the successful installation of the Speedtest CLI utility on our Ubuntu 20.04 system. Python can be installed with the following command:
sudo apt-get install python3-pip
It will take around two to three minutes for the Python installation to complete on your Ubuntu 20.04 system after which you will be able to see the messages shown in the image below on your screen:
Step # 3: Install the Speedtest CLI Utility on your Ubuntu 20.04 System:
After the successful installation of Python, we can conveniently install the Speedtest CLI utility on our Ubuntu 20.04 system with the following command:
sudo pip3 install speedtest-cli
The successful installation of the Speedtest CLI utility on your Ubuntu 20.04 system will display messages similar to the ones shown in the image below on your terminal:
Step # 4: Use the Speedtest CLI Utility for Testing the Internet Speed on your Ubuntu 20.04:
Now, we can easily use the Speedtest CLI utility for testing the Internet speed of our Ubuntu 20.04 system with the following command:
speedtest-cli
It will take a few seconds for this utility to fetch real-time data from the Internet after which you will be able to see a full-fledged report on your Ubuntu 20.04 terminal as shown in the image below:
Bonus Tip:
If you want to share your Internet speed with someone, you can easily generate a shareable link for that which anyone can open in his/her browser to view your Internet speed. The shareable link can be generated by running the following command:
speedtest-cli --share
The shareable link for our current Internet speed is highlighted in the image shown below:
Now, we will attempt to copy and paste this link in our browser as shown in the following image:
When we will press the Enter key, we will be able to see an image of our Internet speed report within our browser as shown in the image below:
Method Uninstalling the Speedtest CLI from Ubuntu 20.04:
The uninstallation method of the Speedtest CLI utility is a bit tricky as you have to remove the packages in the reverse order of installation. We have explained all the steps below:
Step # 1: Remove the Speedtest CLI Utility from your Ubuntu 20.04 System:
First, you have to remove the Speedtest CLI utility from your Ubuntu 20.04 system with the following command:
sudo pip3 uninstall speedtest-cli
After running this command, you will receive a success message on your terminal as shown in the image below:
Step # 2: Remove Python from your Ubuntu 20.04 System:
Now, you need to remove Python from your Ubuntu 20.04 system with the following command:
sudo apt-get purge python3-pip
This command will ensure that Python gets removed along with all of its configuration files after which you will see these messages on your terminal:
Step # 3: Remove all the Additional Packages and Dependencies that are no longer needed on your Ubuntu 20.04 System:
Finally, we can also remove all those packages and dependencies that are no longer needed after uninstalling the above two packages. This can be done by executing the command shown below:
sudo apt-get autoremove
Once the goal of this command will be accomplished, it will display these messages on the terminal:
Conclusion:
By going through today’s article, you will easily be able to install and use the Speedtest CLI utility to test your Internet speed while using Ubuntu 20.04. Finally, when you no longer want to use this utility, then you can conveniently uninstall it with the method prescribed in this article.