How to Install ping Command on Ubuntu Linux

The article provides guidance on installing and using the ping command on Ubuntu Linux, primarily used to test network connectivity. In Ubuntu Minimal Edition or Docker, the ping command could be absent. The solution is to install a package named ‘iputils-ping’ which will restore the ping functionality.

This article explains how to install and use the ping command on Ubuntu Linux.

The ping command is a network utility used to test the connectivity between two devices on a network, typically over an IP network (such as the Internet). It is installed on most operating systems by default.

However, the ping command may not be installed if you have a minimal version of Ubuntu or use Ubuntu as a Docker. If you try to use the ping command, you may get an error that the command cannot be found.

The default apt install ping command in Ubuntu also returns an error that reads, “Package ‘ping’ has no installation candidate.”

Install ping command

As mentioned, if you install Ubuntu Minimal Edition or use Ubuntu as a Docker, the ping command may be missing from the operating systems.

Here’s how to install it.

To install ping, you have to install a package called iputils-ping. The command is how to install it.

sudo apt install iputils-ping

Once the package is installed, you can use the ping command to test network connectivity.

ping localhost

That should do it!

Conclusion:

  • The ping command is a vital network utility for testing connectivity in Ubuntu Linux.
  • Installing the iputils-ping package is necessary to use the ping command in minimal Ubuntu editions or Ubuntu running as a Docker.
  • Verifying network connectivity using ping localhost can ensure that the installation was successful.
Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Exit mobile version