How to install traceroute command in Linux?
What you will read?
The traceroute command is an essential network diagnostic tool that helps track the path packets take from your machine to a destination server. Whether you’re troubleshooting latency issues or just curious about your network routes, traceroute is a must-have.
However, depending on your Linux distribution, traceroute might not be installed by default. Don’t worry — getting it up and running is super easy.
Let’s go through how to install the traceroute command in various Linux distributions.
Installing traceroute on Debian/Ubuntu
If you’re using Ubuntu, Debian, or any Debian-based system like Linux Mint, use the APT package manager.
sudo apt update
sudo apt install traceroute
Once installed, you can verify it with:
traceroute --version
Installing traceroute on CentOS/RHEL/Rocky Linux
For Red Hat-based distributions like CentOS or Rocky Linux, use the dnf or yum command depending on your version.
sudo dnf install traceroute
# or for older systems
sudo yum install traceroute
Still not working after install? Run:
which traceroute
This should return the path /usr/bin/traceroute. If not, check your $PATH variable or re-install the package.
Installing traceroute on Arch Linux / Manjaro
Arch users usually know what they’re doing, but just in case:
sudo pacman -S traceroute
That’s it. The binary will be available right away.
traceroute vs. tracepath — What’s the difference?
Some distros come with tracepath by default instead of traceroute. They serve a similar purpose but behave differently.
For example, try running:
tracepath google.com
You’ll get a hop-by-hop report similar to traceroute, but with less detail and fewer options.
If you specifically want the classic traceroute, it’s better to install it manually as shown above.
Basic Usage of traceroute
Now that it’s installed, let’s run a basic command:
traceroute google.com
You’ll see a list of hops, showing the IP addresses and latency (in ms) for each.
Need to use a specific port or protocol? Use flags like:
traceroute -T -p 443 google.com
That runs a TCP-based traceroute on port 443 (useful for bypassing firewalls that block default UDP traceroutes).
Final tip: Run with sudo if needed
Sometimes, running traceroute without root privileges will give incomplete results or permission errors. If that happens, simply use:
sudo traceroute [hostname]
Now that you’ve got traceroute installed and running, you can dig deep into your network’s path and latency with confidence. Whether you’re debugging server connections or just exploring how data flows through the internet, this little tool packs a big punch.
