> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Ping Command Not Found? Install Ping on Ubuntu
- URL: https://linuxhandbook.com/ping-command-ubuntu/
- Published: 2021-09-15T13:08:09.000Z
- Updated: 2021-09-15T13:08:09.000Z
- Description: If you are running Ubuntu in a Docker container, ping command will be missing. You can install ping on Ubuntu with this simple trick.
- Author: Abhishek Prakash
- Tags: Troubleshooting

Usually, the ping command is already installed on most Linux systems.

But in some rare cases like when you have Ubuntu minimal install or you are running Ubuntu in a Docker container, the ping command is missing. If you try to use it, you will see the ping not found error.

```
root@139a76a6e5d4:/# ping itsfoss.com
bash: ping: command not found
```

That's not the worst thing. You try to install ping and then it complains that it is [unable to locate package](https://itsfoss.com/unable-to-locate-package-error-ubuntu/?ref=linuxhandbook.com) ping.

```
root@139a76a6e5d4:/# apt install ping
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ping
```

![Ping command not found in Ubuntu when running in Docker](https://linuxhandbook.com/content/images/2021/09/ping-command-not-found-ubuntu.png)

Now it gets confusing. Can you not use ping in Ubuntu? Is there no ping command in Ubuntu? That cannot be right, isn't it?

## Installing ping on Ubuntu

The problem here is that ping command is not a package itself. It is part of [iputils package](https://github.com/iputils/iputils?ref=linuxhandbook.com). This is when you try to install a package named ping, it cannot be found.

The actual ping package as part of iputils is called iputils-ping. This is the package you have to install for ping.

First, update the local package cache by running this command as root (use sudo if you are not root):

```
apt update
```

Now, install the iputils-ping package with this command:

```
apt install iputils-ping
```

![Installing ping command on Ubuntu](https://linuxhandbook.com/content/images/2021/09/install-ping-ubuntu.png)

Now, you can [use the ping command](https://linuxhandbook.com/ping-command/).

```
root@139a76a6e5d4:/# ping itsfoss.com
PING itsfoss.com (104.26.10.68) 56(84) bytes of data.
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=1 ttl=56 time=25.1 ms
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=2 ttl=56 time=49.6 ms
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=3 ttl=56 time=34.8 ms
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=4 ttl=56 time=38.9 ms
^C
--- itsfoss.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 25.125/37.095/49.590/8.773 ms

```

![ping command running in Ubuntu](https://linuxhandbook.com/content/images/2021/09/ping-command-ubuntu.png)

If you are using this in a Docker container, you know that changes you made in the container are temporary. You should [use Dockerfile to make permanent changes to the image](https://linuxhandbook.com/create-custom-docker-image/) and the subsequent containers.

I hope you find this quick tip helpful in installing ping command on Ubuntu. If you still have questions or suggestions, please let me know in the comment section.