Ping Command Not Found: How to Install Ping in Ubuntu and Fixing Ping Command Issues
If you are working with Ubuntu or any other Linux distribution, the ping command is one of the most common tools you’ll use to test network connectivity. But sometimes, when you try running it, you may encounter an error message like:
ping: command not found
This can be confusing, especially for beginners. In this guide, we will explore why this error happens, how to fix it, and step-by-step instructions on how to install ping in Ubuntu. By the end, you’ll know exactly how to troubleshoot and resolve any issue related to the ping command.
What is the Ping Command?
The ping command is a simple yet powerful networking utility used to test whether a particular host (server, computer, or website) is reachable across an IP network. It works by sending ICMP (Internet Control Message Protocol) echo requests and listening for replies.
For example:
ping google.com
This will tell you if your internet connection is working and measure the latency between your system and Google’s servers.
Without the ping command, diagnosing basic network issues in Ubuntu becomes more difficult. That’s why fixing it quickly is important.
Why Do You See “Ping Command Not Found”?
There are several reasons why the error Ping Command Not Found might appear on Ubuntu:
Ping is not installed – On some minimal installations of Ubuntu (like servers or containers), the iputils-ping package may not be included by default.
Broken or removed package – If the package was accidentally removed, the command will no longer work.
Incorrect PATH configuration – Rare, but if system paths are misconfigured, Ubuntu may not locate the ping binary.
Permission issues – In some cases, the binary exists but doesn’t have the right permissions.
How to Install Ping in Ubuntu
If your system shows Ping Command Not Found, you need to install the package that provides it. On Ubuntu, the ping command is part of the iputils-ping package.
Here’s how to install it step by step:
Step 1: Update the package list
Always start by updating your package index so you get the latest version:
sudo apt update
Step 2: Install iputils-ping
Run the following command to install ping:
sudo apt install iputils-ping -y
Step 3: Verify the installation
Check if ping is working now:
ping -c 4 google.com
You should see replies confirming that the installation was successful.
Fixing Ping Command in Ubuntu
Sometimes, even after installation, the ping command might not work as expected. Here are different fixes for common issues:
1. Reinstall Ping
If the binary is corrupted or missing, reinstall it:
sudo apt remove iputils-ping -y sudo apt install iputils-ping -y
2. Check the Path
Verify that ping is located in the correct directory:
which ping
Usually, it should be in /usr/bin/ping. If not found, reinstallation will fix it.
3. Run with sudo
On some Ubuntu versions, you may need elevated privileges:
sudo ping google.com
4. Check Permissions
If ping exists but isn’t executable, fix its permissions:
sudo chmod +x /usr/bin/ping
5. Use Alternative Network Tools
If you cannot get ping to work, you can use alternative commands like:
curl or wget to check internet connectivity.
traceroute for route debugging.
ping6 for IPv6 networks.
Example: Fixing Ping Command in Ubuntu Server
Imagine you installed Ubuntu Server (minimal version), and when you try:
ping 8.8.8.8
It returns:
ping: command not found
To fix this:
Update packages:
sudo apt update
Install ping:
sudo apt install iputils-ping -y
Verify:
ping -c 3 ubuntu.com
This should show successful replies.
Preventing Future Ping Issues
To avoid running into ping command not found again:
Always use the latest LTS version of Ubuntu for stability.
Keep your system updated with sudo apt upgrade.
When setting up servers, remember that minimal images may exclude networking tools, so install them manually.
Conclusion
The error Ping Command Not Found is common on fresh Ubuntu installations, especially minimal servers. The solution is simple: install the missing package with:
sudo apt install iputils-ping
If you face additional issues, troubleshooting methods like checking permissions, reinstalling, or running with sudo can help in fixing ping command errors.
Whether you’re a system administrator, developer, or beginner learning Linux, knowing how to install ping in Ubuntu is an essential skill for network troubleshooting. Next time you encounter connectivity issues, you’ll be ready to diagnose them quickly.














