<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vihanga Deshan's Blog]]></title><description><![CDATA[Sri Lanka I am Vihanga Deshan. I am a simple , creative, enthusiastic and fun-loving person. I always like to create something on my own which is helpful for ot]]></description><link>https://blog.vihangadeshan.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 18:32:27 GMT</lastBuildDate><atom:link href="https://blog.vihangadeshan.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA["Ping not found" - How to Install Ping on Ubuntu]]></title><description><![CDATA[Usually, the ping command is already installed on most Linux systems.
But in some rare cases like when you have Ubuntu minimal install or you are running Ubuntu in a Docker container, the ping command is missing. If you try to use it, you will see th...]]></description><link>https://blog.vihangadeshan.com/ping-not-found-how-to-install-ping-on-ubuntu</link><guid isPermaLink="true">https://blog.vihangadeshan.com/ping-not-found-how-to-install-ping-on-ubuntu</guid><category><![CDATA[Linux]]></category><category><![CDATA[linux for beginners]]></category><category><![CDATA[linux-basics]]></category><category><![CDATA[linux-commands]]></category><dc:creator><![CDATA[Vihanga Deshan]]></dc:creator><pubDate>Sun, 25 Dec 2022 10:43:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671964922190/d21e326d-4eca-4416-a20b-f84e7899410b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Usually, the ping command is already installed on most Linux systems.</p>
<p>But in some rare cases like when you have Ubuntu minimal install or you are running Ubuntu in a Docker container, the ping command is missing. If you try to use it, you will see the ping not found error.</p>
<pre><code class="lang-plaintext">root@139a76a6e5d4:/# ping itsfoss.com
bash: ping: command not found
</code></pre>
<p>That's not the worst thing. You try to install ping and then it complains that it is <a target="_blank" href="https://itsfoss.com/unable-to-locate-package-error-ubuntu/">unable to locate package</a> ping.</p>
<pre><code class="lang-plaintext">root@139a76a6e5d4:/# apt install ping
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ping
</code></pre>
<p><img src="https://linuxhandbook.com/content/images/2021/09/ping-command-not-found-ubuntu.png" alt="Ping command not found in Ubuntu when running in Docker" /></p>
<p>Now it gets confusing. Can you not use ping in Ubuntu? Is there no ping command in Ubuntu? That cannot be right, isn't it?</p>
<h2 id="heading-installing-ping-on-ubuntu"><strong>Installing ping on Ubuntu</strong></h2>
<p>The problem here is that the ping command is not a package itself. It is part of <a target="_blank" href="https://github.com/iputils/iputils">iputils package</a>. This is when you try to install a package named ping, it cannot be found.</p>
<p>The actual ping package as part of iputils is called iputils-ping. This is the package you have to install for ping.</p>
<p>First, update the local package cache by running this command as root (use sudo if you are not root):</p>
<pre><code class="lang-plaintext">apt update
</code></pre>
<p>Now, install the iputils-ping package with this command:</p>
<pre><code class="lang-plaintext">apt install iputils-ping
</code></pre>
<p>Now, you can <a target="_blank" href="https://linuxhandbook.com/ping-command/">use the ping command</a>.</p>
<pre><code class="lang-plaintext">root@139a76a6e5d4:/# ping itsfoss.com
PING itsfoss.com (104.26.10.68) 56(84) bytes of data.
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=1 ttl=56 time=25.1 ms
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=2 ttl=56 time=49.6 ms
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=3 ttl=56 time=34.8 ms
64 bytes from 104.26.10.68 (104.26.10.68): icmp_seq=4 ttl=56 time=38.9 ms
^C
--- itsfoss.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 25.125/37.095/49.590/8.773 ms
</code></pre>
<p><img src="https://linuxhandbook.com/content/images/2021/09/ping-command-ubuntu.png" alt="ping command running in Ubuntu" /></p>
<p>If you are using this in a Docker container, you know that the changes you made in the container are temporary. You should <a target="_blank" href="https://linuxhandbook.com/create-custom-docker-image/">use Dockerfile to make permanent changes to the image</a> and the subsequent containers.</p>
<p>I hope you find this quick tip helpful in installing the ping command on Ubuntu. If you still have questions or suggestions, please let me know in the comment section.</p>
]]></content:encoded></item></channel></rss>