Table of Contents
In this article, we will see how to install traceroute command on Ubuntu 22.04 LTS (Jammy Jellyfish). traceroute is one of the most popular and probably one of the most frequently used utility in network problems and troubleshooting. It is freely and widely available in almost all the famous platforms such as Windows, Linux and Unix based systems.
Basically, traceroute traces the routing of IP packets by sending Internet Control Message Protocol(ICMP) packets to all the hops which were involved in transferring the data. Depending on the ICMP response, traceroute determines the route of the packets. It is also very easy to install and use. Here we will see the steps to install traceroute command on Ubuntu 22.04 LTS server in great detail.
How to Install traceroute command on Ubuntu 22.04 LTS (Jammy Jellyfish)
Also Read: How to Install Elasticsearch on Ubuntu 22.04 LTS (Jammy Jellyfish)
Step 1: Prerequisites
a) You should have a running Ubuntu 22.04 LTS
Server
b) You should have sudo
or root
access to run privileged commands.
c) You should have apt
or apt-get
utility available in your Server.
Step 2: Update Your Server
In the first step, you need to download and install all the latest available updates from default Ubuntu repo by using sudo apt update && sudo apt upgrade
command as shown below.
cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
[sudo] password for cyberithub:
Hit:1 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:4 https://dl.google.com/linux/chrome/deb stable InRelease [1,825 B]
Get:5 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Get:7 https://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,081 B]
Get:8 http://in.archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [430 kB]
Get:9 http://security.ubuntu.com/ubuntu jammy-security/main amd64 DEP-11 Metadata [41.5 kB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 DEP-11 Metadata [22.0 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [723 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [99.5 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [932 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [274 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B]
Get:16 http://in.archive.ubuntu.com/ubuntu jammy-backports/main amd64 DEP-11 Metadata [8,000 B]
Get:17 http://in.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [15.4 kB]
Fetched 2,886 kB in 4s (652 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Step 3: Install traceroute
In the next step, you can install traceroute from default Ubuntu repo by using sudo apt install traceroute
command as shown below. This will download and install the package along with all its dependencies.
cyberithub@ubuntu:~$ sudo apt install traceroute Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: traceroute 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 45.4 kB of archives. After this operation, 152 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 traceroute amd64 1:2.1.0-2 [45.4 kB] Fetched 45.4 kB in 1s (44.9 kB/s) Selecting previously unselected package traceroute. (Reading database ... 203621 files and directories currently installed.) Preparing to unpack .../traceroute_1%3a2.1.0-2_amd64.deb ... Unpacking traceroute (1:2.1.0-2) ... Setting up traceroute (1:2.1.0-2) ... update-alternatives: using /usr/bin/traceroute.db to provide /usr/bin/traceroute (traceroute) in auto mode update-alternatives: using /usr/bin/traceroute6.db to provide /usr/bin/traceroute6 (traceroute6) in auto mode update-alternatives: using /usr/bin/lft.db to provide /usr/bin/lft (lft) in auto mode update-alternatives: using /usr/bin/traceproto.db to provide /usr/bin/traceproto (traceproto) in auto mode update-alternatives: using /usr/sbin/tcptraceroute.db to provide /usr/sbin/tcptraceroute (tcptraceroute) in auto mode Processing triggers for man-db (2.10.2-1) ...
Step 4: Verify Installation
After successful installation, you can verify the installed files path by using dpkg -L traceroute
command as shown below.
cyberithub@ubuntu:~$ dpkg -L traceroute
/.
/usr
/usr/bin
/usr/bin/lft.db
/usr/bin/traceproto.db
/usr/bin/traceroute-nanog
/usr/bin/traceroute.db
/usr/include
/usr/include/clif.h
/usr/lib
/usr/lib/libsupp.a
/usr/sbin
/usr/sbin/tcptraceroute.db
/usr/share
/usr/share/doc
/usr/share/doc/traceroute
/usr/share/doc/traceroute/CREDITS
/usr/share/doc/traceroute/README
/usr/share/doc/traceroute/TODO
/usr/share/doc/traceroute/changelog.Debian.gz
/usr/share/doc/traceroute/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/traceroute.db.1.gz
/usr/share/man/man8
/usr/bin/traceroute6.db
/usr/share/man/man1/lft.db.1.gz
/usr/share/man/man1/traceproto.db.1.gz
/usr/share/man/man1/traceroute-nanog.1.gz
/usr/share/man/man1/traceroute6.db.1.gz
/usr/share/man/man8/tcptraceroute.db.8.gz
Step 5: Check Version
You can also verify the current installed version by using traceroute -V
command as shown below.
cyberithub@ubuntu:~$ traceroute -V Modern traceroute for Linux, version 2.1.0 Copyright (c) 2016 Dmitry Butskoy, License: GPL v2 or any later
Step 6: Using traceroute
Now that traceroute is successfully installed, we can use it to trace the path of a destination host. For example, here we are tracing the path to google.com
using traceroute google.com
command as shown below.
cyberithub@ubuntu:~$ traceroute google.com traceroute to google.com (142.250.193.110), 30 hops max, 60 byte packets 1 _gateway (192.168.0.1) 8.483 ms 7.948 ms 7.554 ms 2 * * * 3 100.65.0.14 (100.65.0.14) 149.145 ms !X 149.209 ms !X 100.65.0.10 (100.65.0.10) 148.747 ms !X
From the output, you can notice that by default traceroute sends 60 byte packets to maximum of 30 hops. The path can be interpreted as follows:-
- _gateway is the gateway hop 192.168.0.1, next to the source IP.
- * denotes that router does not want to publish their information and hence did not provided any response.
- trace ended at the destination host.
Step 7: Uninstall traceroute
Once you are done using traceroute, you can choose to uninstall it from your server using sudo apt remove traceroute
command as shown below.
cyberithub@ubuntu:~$ sudo apt remove traceroute Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages will be REMOVED: traceroute 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 152 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 203641 files and directories currently installed.) Removing traceroute (1:2.1.0-2) ... Processing triggers for man-db (2.10.2-1) ...