本文主要是介绍macOS 安装mtr 和mtr: Failure to start mtr-packet: Invalid argument 错误的解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.通过Homebrew安装mtr
brew install mtr
先出现一个错误提示:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink sbin/mtr
Target /usr/local/sbin/mtr
already exists. You may want to remove it:
rm '/usr/local/sbin/mtr'
To force the link and overwrite all conflicting files:
brew link --overwrite mtr
To list all files that would be deleted:
brew link --overwrite --dry-run mtr
==> Caveats
mtr requires root privileges so you will need to run `sudo mtr`.
You should be certain that you trust any software you grant root privileges.
那是因为以前装了旧版,按照提示运行如下命令再来一次
brew link --overwrite mtr
然后出现如下提示:
Linking /usr/local/Cellar/mtr/0.92... 10 symlinks created
2. 尝试运行(注意要求sudo运行):
sudo /usr/local/sbin/mtr www.google.com
提示
mtr: Failure to start mtr-packet: Invalid argument
搜了一下,发现解决方法也很简单:
把usr/local/sbin/下面的 mtr 和 mtr-packet 复制到/usr/local/bin 下面即可。
再次运行没问题了。
sudo /usr/local/bin/mtr www.google.com
因为以前装过旧版,我不知道是否需要创建alias也能直接省略路径,反正我这里直接用可以:
sudo mtr www.google.com
然后我用alias命令看了一下alias列表,里面并没有mtr相关内容。
这篇关于macOS 安装mtr 和mtr: Failure to start mtr-packet: Invalid argument 错误的解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!