How to Install ping Command on Ubuntu Linux

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.

Frequently Asked Questions

What is the ping command used for in Ubuntu?

The ping command is a network utility used to test the connectivity between two devices on a network. It sends packets to a specified IP address and measures the time it takes for a response.

How can I install the ping command on Ubuntu?

To install the ping command on Ubuntu, you need to install the 'iputils-ping' package. You can do this by running the command 'sudo apt install iputils-ping' in the terminal.

Why is the ping command missing on my Ubuntu installation?

The ping command may be missing if you are using a minimal version of Ubuntu or running Ubuntu as a Docker container. These installations often do not include certain utilities by default.

What should I do if I receive an error saying 'Package ping has no installation candidate'?

This error indicates that the ping package is not available in your repository. You should ensure that your package list is updated by running 'sudo apt update' before attempting to install 'iputils-ping'.

How can I verify that the ping command is installed correctly?

After installing the ping command, you can verify its functionality by running 'ping localhost' in the terminal. If the command works and you receive responses, the installation was successful.

Categories:

Leave a Reply

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