Score:1

sudo traceroute -n . Not working

in flag

I tried to run a traceroute command "sudo traceroute -n www.google.com" in my Ubuntu guest machine in an Oracle Virtual Box. it displays this message

traceroute: invalid option -- 'n'
Try 'traceroute --help' or 'traceroute --usage' for more information.

Ubuntu version: 20.04.3 LTS
I installed traceroute : sudo apt-get install net-tools.I installed this and then ran the command sudo apt-get update

What could I be doing wrong? I checked it -n flag exists and it does. And also whenever I try tracetrouting a site it always shows request timed out after the first hop (this is a Virtual Machine). What changes should I do?

cocomac avatar
cn flag
Huh. When I do `traceroute -n www.google.com` (with or without `sudo`), it works fine. I'm using 20.04.3 LTS. What version of Ubuntu do you have installed? Also, how did you install traceroute? I did `sudo apt-get update && sudo apt-get install traceroute`.
in flag
I edited the question.
cocomac avatar
cn flag
What is the output of these commands: `dpkg -s traceroute`, `which traceroute`, and `whereis traceroute`? It's worth noting that `net-tools` doesn't contain traceroute. So I'm trying to figure out how you installed it
in flag
I checked all the commands which you told me to and I also ran `sudo apt-get install traceroute` and all say that traceroute is installed. The status when I ran `dpkg -s traceroute` shows `Package: traceroute Status: install ok installed`. So I think traceroute has been installed right.
Score:2
in flag

There are several forks of traceroute with different options. If you have more than one installed, the update-alternatives command will let you choose a default.

For example:

$ update-alternatives --display traceroute
traceroute - auto mode
  link best version is /usr/bin/traceroute.db
  link currently points to /usr/bin/traceroute.db
  link traceroute is /usr/bin/traceroute
  slave traceroute.1.gz is /usr/share/man/man1/traceroute.1.gz
  slave traceroute.sbin is /usr/sbin/traceroute
/usr/bin/traceroute.db - priority 100
  slave traceroute.1.gz: /usr/share/man/man1/traceroute.db.1.gz
  slave traceroute.sbin: /usr/bin/traceroute.db

This is a version of traceroute that accepts the -n option.

$ dpkg -S /usr/bin/traceroute.db
traceroute: /usr/bin/traceroute.db

It comes from the traceroute package (apt-get install traceroute) rather than the net-utils package.

If you have it installed, you can run it as traceroute.db or you can use

update-alternatives --configure traceroute

to pick the default version assigned to the traceroute command.

in flag
Thank you, my traceroute was working on the version which I installed through net-tools, but now I changed it to a newer one which you suggested. But what can I do about the request timed out problem. It never completes tracing it just shows request timed out ( I am using a VM) (network settings is : bridge adapter, even tried :NAT)?
user10489 avatar
in flag
That sounds like a routing problem, which is the kind of thing traceroute was designed to debug. But you haven't given enough information to even consider that. I suggest you ask a separate question about it and include output from traceroute, `ip route` ; `ip addr`
in flag
I have raised another question relating this problem here is the [link](https://askubuntu.com/q/1389773/1565863). It would be great if you could solve it. Thank you.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.