想在mac上面使用mtr,于是使用brew安装了一个mtr。
brew install mtr
mtr在mac下面需要用sudo,而且他没有给我连接mtr命令,所以调用方式变成了:
/usr/local/sbin/mtr
这个也没关系,将就用,但是一运行,就出现了下面的错误:
~ git:(master) sudo /usr/local/sbin/mtr baidu.com
Password:
mtr: Failure to start mtr-packet: Invalid argument
于是果断谷歌之。看到国人博客,遇到相同的问题,解决方法是:brew链接问题,uninstall,然后重新安装就可以。。。。 ?????好吧我信你的邪,重装一次,并没什么用。然后看gayhub有人提交了相关issue,进去一看,发现了以下内容:
- Locate it in the path (this would mean adding
/usr/local/sbin
to your path of course). - Locate it using the env variable
MTR_PACKET
, which overrides the path. - Have it located in the current directory, i.e
$PWD=/usr/local/sbin
.
有时候,一个总之删掉重装的说法,确实能解决问题,但是这个并不能真正解决问题啊。