Install Ping On Ubuntu: Ping Command Not Found

Tutorial to install ping on Ubuntu in a Docker container

Docker is a set of platforms as a service where you can use containers to deliver the software or applications. So you are using Ubuntu in a docker container and trying to run a command to execute a ping command then you might have come across the error like:

bash: ping: command not found

and the funniest but frustrating part is then when you try to install the ping tool command and again you have to deal with errors like:

E: Unable to locate package ping

Most people might ask why the Ping command is missing as Ping is installed by default in most of the Linux operating systems. Ping will be missing from Ubuntu if you have installed the minimal version of Ubuntu.

Install Ping On Ubuntu: Ping Command Not Found

For your kind information, the ping tool is a part of iputils-ping package and you need to install iputils-ping package to get the ping tool command in your Ubuntu. Run the following command to install iputils-ping package to get the ping tool.

apt update
apt install iputils-ping

Now, you can use the ping command without any issue in Ubuntu in a docker container and don’t forget to make permanent changes to the image and the subsequent containers in your docker otherwise you won’t get the ping command once you restarted your docker.

Summary: This is the solution for the “ping command not found” error on Ubuntu in a docker container. I hope this process works without any issue in your system.

Meanwhile, check our blog post on:

  1. Docker Compose Up, Docker Compose Down, Docker Compose Start, and Docker Compose Stop

  2. How To Set Hostname In Docker Compose | Docker Compose Tutorial

  3. Run Linux On Windows 11: Install Linux Bash Shell on Windows 11

READ More Relevant Stuff:  Install Linux, Apache, MySQL, PHP On Ubuntu 20.04 (LAMP)

Leave a Reply

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