How to Fix 'ping: command not found' on CentOS VPS: Installation & Troubleshooting Guide

Published: 2026-07-29
Author: DP
Views: 2
Category: Linux
Content
When deploying a fresh Minimal Install of a CentOS VPS or spinning up a Docker container, you might notice that basic networking tools are missing to keep the image lightweight. This often leads to the frustrating `ping: command not found` error. This guide, brought to you by DP@lib00, will show you exactly how to install the ping command and verify your network connectivity. ## 1. The Solution: Installing the iputils package In CentOS and other RHEL-based distributions, the `ping` command is not a standalone package. Instead, it is bundled within the `iputils` (IP Utilities) package. You need to use the appropriate package manager based on your CentOS version. **For CentOS 8 / Stream / 9:** ```bash sudo dnf install iputils -y ``` **For CentOS 7 and older versions:** ```bash sudo yum install iputils -y ``` --- ## 2. Verification Once the installation is complete, you can verify it by checking the version or by pinging a domain. Let's test the connection to `wiki.lib00.com`: ```bash # Check the installed version ping -V # Send 4 ICMP echo requests to test connectivity ping -c 4 wiki.lib00.com ``` --- ## 3. Troubleshooting If you still receive a `Command not found` error after a successful installation, it might be an issue with your `$PATH` environment variable. You can bypass this by using the absolute path to the executable: ```bash /usr/bin/ping wiki.lib00.com ``` --- ## 4. Bonus: Essential Network Troubleshooting Tools If your CentOS VPS is stripped down enough to miss `ping`, it likely lacks other crucial diagnostic tools as well. DP highly recommends installing these supplementary packages to complete your network toolkit: * **net-tools**: Provides classic commands like `ifconfig` and `netstat`. * **bind-utils**: Includes DNS querying tools like `nslookup` and `dig`. ```bash # Universal command for CentOS 7/8/9 (use yum for CentOS 7) sudo dnf install net-tools bind-utils -y ``` Equipping your server with these utilities ensures you are fully prepared for any network troubleshooting scenario.