-bash: mtr: command not found

Hi, I just installed homebrew to install mtr,

So my Mac has Sierra installed Xcode and its command line tools.
The homebrew install was straightforward but after installing the program it’s not working:

I’m giving the full output:

ws1mbp:~ maverick$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/var

Press RETURN to continue or any other key to abort


==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew /usr/local/Frameworks /usr/local/var
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew /usr/local/Frameworks /usr/local/var
==> /usr/bin/sudo /bin/chmod u+rwx share/zsh share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown maverick /usr/local/Homebrew /usr/local/Frameworks /usr/local/var
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew /usr/local/Frameworks /usr/local/var
==> /usr/bin/sudo /bin/mkdir -p /Users/maverick/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/maverick/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown maverick /Users/maverick/Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 3647, done.
remote: Compressing objects: 100% (2536/2536), done.
remote: Total 3647 (delta 1751), reused 2323 (delta 971), pack-reused 0
Receiving objects: 100% (3647/3647), 2.25 MiB | 1.70 MiB/s, done.
Resolving deltas: 100% (1751/1751), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
 * [new tag]         0.1        -> 0.1
 * [new tag]         0.2        -> 0.2
 * [new tag]         0.3        -> 0.3
 * [new tag]         0.4        -> 0.4
 * [new tag]         0.5        -> 0.5
 * [new tag]         0.6        -> 0.6
 * [new tag]         0.7        -> 0.7
 * [new tag]         0.7.1      -> 0.7.1
 * [new tag]         0.8        -> 0.8
 * [new tag]         0.8.1      -> 0.8.1
 * [new tag]         0.9        -> 0.9
 * [new tag]         0.9.1      -> 0.9.1
 * [new tag]         0.9.2      -> 0.9.2
 * [new tag]         0.9.3      -> 0.9.3
 * [new tag]         0.9.4      -> 0.9.4
 * [new tag]         0.9.5      -> 0.9.5
 * [new tag]         0.9.8      -> 0.9.8
 * [new tag]         0.9.9      -> 0.9.9
 * [new tag]         1.0.0      -> 1.0.0
 * [new tag]         1.0.1      -> 1.0.1
 * [new tag]         1.0.2      -> 1.0.2
 * [new tag]         1.0.3      -> 1.0.3
 * [new tag]         1.0.4      -> 1.0.4
 * [new tag]         1.0.5      -> 1.0.5
 * [new tag]         1.0.6      -> 1.0.6
 * [new tag]         1.0.7      -> 1.0.7
 * [new tag]         1.0.8      -> 1.0.8
HEAD is now at 512a0c9 Merge pull request #1355 from reitermarkus/fix-depends-on-test
==> Homebrew has enabled anonymous aggregate user behaviour analytics
Read the analytics documentation (and how to opt-out) here:
https://git.io/brew-analytics
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3741, done.
remote: Compressing objects: 100% (3631/3631), done.
remote: Total 3741 (delta 12), reused 299 (delta 1), pack-reused 0
Receiving objects: 100% (3741/3741), 3.00 MiB | 4.08 MiB/s, done.
Resolving deltas: 100% (12/12), done.
Checking connectivity... done.
Tapped 3620 formulae (3,768 files, 9.3M)
Already up-to-date.
==> Installation successful!
==> Next steps
Run `brew help` to get started
Further documentation: https://git.io/brew-docs

ws1mbp:~ maverick$ brew install mtr
Error: You must `brew link autoconf automake` before mtr can be installed

ws1mbp:~ maverick$ brew link autoconf automake
Linking /usr/local/Cellar/autoconf/2.69... 48 symlinks created
Linking /usr/local/Cellar/automake/1.15... 113 symlinks created

ws1mbp:~ maverick$ brew install mtr
==> Downloading https://homebrew.bintray.com/bottles/mtr-0.87.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mtr-0.87.sierra.bottle.tar.gz
==> 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.
==> Summary
🍺  /usr/local/Cellar/mtr/0.87: 8 files, 137.3K

ws1mbp:~ maverick$ sudo mtr google.com
sudo: mtr: command not found

What I am I missing? Can’t seem to find more info on this.

Assuming it’s been installed correctly, you probably need to add /usr/local/sbin to your path, or explicitly run sudo /usr/local/sbin/mtr. (You also may need to create that directory and give it correct permissions before installing.)

3 Likes

Hi Andrew sorry for the late reply (I actually made a note for it).
It was a $PATH related issue and its fixed now after adding /usr/local/sbin

thank you!

No, it’s not. I still have the issue on macOS 10.13.6 with Brew 2.2.0

Hi man, you can add a line to your .zshrc or .bashrc wtv suits you with:

alias mtr=‘sudo /usr/local/sbin/mtr’

that will get you going with mtr no issues. or you can also add

export PATH="$PATH:/usr/local/sbin" to add that location to your PATH variable.
Anyway, since mtr requires sudo, I prefer the first one.
I have no idea how brew is working nowadays, I replaced almost all with docker containers, much cleaner and efficient.