How to Install Ping and ping6 command on CentOS 8

How to Install Ping and ping6 command on CentOS 8 / RHEL 8 Linux server

 

Ping is a software used on Linux servers to check connectivity between hosts / servers. Ping command is used to check whether the destination server / host is reachable.

I got the below error on my CentOS 8 server while trying to ping google DNS server.
 

[root@server /]# ping 8.8.8.8
bash: ping: command not found
 
root@server [/]# ping 8.8.4.4
-bash: /usr/bin/ping: No such file or directory
-bash: /usr/sbin/ping: No such file or directory
 
# ping6 2001:4860:4860::8888
bash: ping6: command not found

 
Error shows that ping command is not installed on your server. Do the below steps to install ping command on your CentOS 8 / Redhat 8 Server.

1. Log into your linux server via SSH as ‘root’ user

2. Install iputils package on your server using yum command

3. Enter ‘y’ and press enter, if yum ask for confirmation while installing

4. Ping to any host or server to verify the installation
 

[root@server /]# ping 8.8.8.8
bash: ping: command not found
 
[root@server /]# yum install iputils
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:32:11 ago on Tue Jun 2 16:06:43 2020.
Dependencies resolved.
===================================================================================================
Package Architecture Version Repository Size
===================================================================================================
Installing:
iputils x86_64 20180629-2.el8 BaseOS 148 k

Transaction Summary
===================================================================================================
Install 1 Package

Total download size: 148 k
Installed size: 343 k
Is this ok [y/N]: y
Downloading Packages:
iputils-20180629-2.el8.x86_64.rpm 400 kB/s | 148 kB 00:00
—————————————————————————————————
Total 168 kB/s | 148 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : iputils-20180629-2.el8.x86_64 1/1
Running scriptlet: iputils-20180629-2.el8.x86_64 1/1
Verifying : iputils-20180629-2.el8.x86_64 1/1

Installed:
iputils-20180629-2.el8.x86_64

Complete!

 
[root@server /]# ping 8.8.4.4

— 8.8.4.4 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 18.866/19.269/19.827/0.407 ms

 

How to Install Ping on CentOS Redhat 8 Server

How to Install Ping on CentOS Redhat 8 Server


 
 

How to Download and Install iputils rpm on CentOS 8 / RHEL 8

1. Log into CentOS 8 / Redhat 8 server as ‘root’ user

2. Download iputils rpm from CentOS website using wget command

3. Install iputils package either using yum or rpm command

 

# cd /usr/local/src/
 
# wget http://mirror.centos.org/centos/8/BaseOS/x86_64/ os/Packages/iputils-20180629-2.el8.x86_64.rpm
 
# yum install iputils-20180629-2.el8.x86_64.rpm
OR
# rpm -Uvh iputils-20180629-2.el8.x86_64.rpm

 
Note: Yum will install iputils and the required dependencies for iputils package. You must manually install the dependencies if you are using rpm command to install iputils.
 

How to Install iputils rpm on CentOS Redhat 8

How to Install iputils rpm on CentOS Redhat 8


 
 

How to Remove / uninstall ping command

1. You must log into your CentOS / Redhat server as root user

2. Run the command ‘yum remove iputils’ to remove ping command

3. Enter ‘y’, if yum ask for confirmation
 

How to remove ping command Linux

How to remove ping command Linux