sudo traceroute -n 。不起作用

sudo traceroute -n 。不起作用

我尝试在 Oracle Virtual Box 中的 Ubuntu 客户机中运行跟踪路由命令“sudo traceroute -n www.google.com”。它显示此消息

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

Ubuntu 版本:20.04.3 LTS
我安装了 traceroute:sudo apt-get install net-tools。我安装了它,然后运行命令 sudo apt-get update

我可能做错了什么?我检查了 -n 标志是否存在,确实存在。而且每当我尝试跟踪某个站点时,它总是显示请求在第一个跳转后超时(这是虚拟机)。我应该做哪些更改?

答案1

traceroute 有多个分支,具有不同的选项。如果您安装了多个,update-alternatives 命令将允许您选择默认选项。

例如:

$ 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

这是接受该选项的 traceroute 版本-n

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

它来自 traceroute 包(apt-get install traceroute)而不是 net-utils 包。

如果你已经安装了它,你可以将其作为 traceroute.db 运行,或者你可以使用

update-alternatives --configure traceroute

选择分配给 traceroute 命令的默认版本。

相关内容