ping: command not found. How to install ping on CentOS / Ubuntu

How to install ping command on Ubuntu Server

Error :

root@server:/# ping 8.8.8.8
bash: ping: command not found

I got the above error while trying to ping on my ubuntu server. Error shows ping command is not installed on the server. Do the below steps to install ping.

1. Log into your ubuntu server as root or any user with sudo privileges

2. Run the command “apt-get update” to download package list from the repository

command : apt-get update

3. After running apt-get update, run the command ‘apt-get install iputils-ping’ to install ping.

command : apt-get install iputils-ping

# apt-get install iputils-ping
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libcap2 libcap2-bin libidn11 libpam-cap

Do you want to continue? [Y/n] y

4. Ping package is installed on the ubuntu server and you can run the below command to verify

# dpkg –list | grep ping
ii iputils-ping 3:20161105-1ubuntu2 amd64 Tools to test the reachability of network hosts

 


 

How to Install Ping on CentOS / Redhat servers

1. Log into your Linux server as ‘root’ user

2. Run the command “yum whatprovides ping” to get the package name

3. Install iputils network monitoring tool using yum :

Command : yum install iputils