Ping command not found on Ubuntu 20.04 Focal Fossa Linux

Depending on your Ubuntu 20.04 Server/Desktop installation your system might not come with the ping command pre-installed. This is especially the case for docker containers. Any attempt to ping a remote system will result in the following error:

bash: ping: command not found

In this tutorial you will learn:

  • How to install ping command on Ubuntu

Install ping command on Ubuntu 20.04

Install ping command on Ubuntu 20.04

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Install ping command on Ubuntu 20.04 step by step instructions

  1. Update the system package index:
    $ sudo apt update

  2. Install the missing ping command:
    $ sudo apt install iputils-ping
  3. The missing ping command should now be installed and ready to use:
    $ which ping
    $ ping -c 1
    PING ( 56(84) bytes of data.
    64 bytes from ( icmp_seq=1 ttl=59 time=12.1 ms
    --- ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 12.122/12.122/12.122/0.000 ms