10
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

brew install mtr macOS10.15

Posted at

##homebrewでmtrを導入したらパスが通っていなかったメモ
結論だけ知りたい方は、まとめ参照

homebrewでmtrをインストール

% brew install mtr
|
|
🍺  /usr/local/Cellar/mtr/0.94
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.

8.8.8.8に向けてmtrを実行したが、mtrがないらしい

% sudo mtr 8.8.8.8
Password:
sudo: mtr: command not found

パスを見てみると、/usr/local/Cellar/mtr/0.94らしい。

~ % brew link mtr
Warning: Already linked: /usr/local/Cellar/mtr/0.94
To relink:
  brew unlink mtr && brew link mtr

中身を見てみると、それっぽいのがない

% ls /usr/local/Cellar/mtr/0.94
AUTHORS			INSTALL_RECEIPT.json	README.md		sbin
COPYING			NEWS			TODO			share

こっちにあった。

% ls /usr/local/Cellar/mtr/0.94/sbin
mtr		mtr-packet

リンク作成①

% ln /usr/local/Cellar/mtr/0.94/sbin/mtr /usr/local/bin/mtr

再度実行すると、mtr-packetもいるらしい

% sudo mtr 8.8.8.8
mtr: Failure to start mtr-packet: Invalid argument

リンク作成②

% ln /usr/local/Cellar/mtr/0.94/sbin/mtr-packet /usr/local/bin/mtr-packet

もっかい実行、動いた

                               My traceroute  [v0.94]
xxxxx-MacBook-Pro.local (172.31.xxx.xxx) -> 8.8.8.8        2020-10-15T23:41:13+0900
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                            Packets               Pings
 Host                                     Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 172.31.xxx.xxx                         0.0%     5    1.7   3.3   1.7   9.4   3.4
 2. 10.255.xxx.xxx                         0.0%     5    2.0   3.2   1.9   8.0   2.7
 3. xxxxxxxxxxxxxxx.ppp-bb.dion.ne.jp      0.0%     5    4.2   3.8   3.4   4.2   0.3
 4. xxxxxxxxxxxx.bb.kddi.ne.jp             0.0%     5    6.4   5.5   5.0   6.4   0.5
 5. xxxxxxxxx.bb.kddi.ne.jp                0.0%     5   16.5   8.3   5.1  16.5   4.7
 6. 27.85.xxx.xx                           0.0%     5    9.3   9.8   7.1  17.1   4.2
 7. 27.85.xxx.xx                           0.0%     5    9.7   8.4   6.2  13.3   3.1
 8. 72.14.xxx.xx                           0.0%     5    7.1   9.5   6.2  13.9   3.5
 9. 209.85.xxx.xx                          0.0%     5    5.7   6.4   5.7   7.7   0.8
10. 72.14.xxx.xxx                          0.0%     4    5.9   8.5   5.9  12.9   3.2
11. dns.google                             0.0%     4    6.3   6.7   5.7   8.0   1.0                                                                                                                                       

##まとめ

% brew install mtr
% ln /usr/local/Cellar/mtr/0.94/sbin/mtr /usr/local/bin/mtr
% ln /usr/local/Cellar/mtr/0.94/sbin/mtr-packet /usr/local/bin/mtr-packet

以上

10
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?