How to install MTR on Mac

1. Open the following link http://brew.sh/

2. Once the page is open you will see a language option, set your preferred language.

3. Below the language preference you will see the following.

MTR_1.gif

4. Highlight the text in the black box and click “Command C” on your keyboard.

5. Once you have copied this open a window in “Finder”.

6. In finder click “Applications” (This is located on the left below “Favorites”).

7. Scroll to the bottom of applications and locate the folder named “Utilities” and double click on it.

MTR_2.gif

8. At the bottom of the page open “Terminal”.

9. Once terminal is open click “Command V” on your keyboard and hit enter two times.

MTR_3.gif

10. After you hit enter it will ask for your computer password. (You won't see the characters type)

11. Once the install is complete type “brew install mtr” and hit enter.

MTR_4.gif

12. Once the install is complete type “sudo mtr”.

13. A new window should open that looks like the following.

MTR_8.gif

14. If this window opens, then you have successfully installed Homebrew. If this window does not open, please Refer to Section A.

  

 A. “Command not found” error when attempting “sudo mtr”. (These are case Sensitive commands)

  1. Type “sudo su – “ in the terminal line and hit enter.
  2. You should now see “root#” before the terminal line.
  3. Type “ls /usr/local/” in the terminal and hit enter.MTR_6.gif
  4. Now hit the “Up” arrow on your keyboard. Doing this should retype the same command that was in Step 3.
  5. Now type “C” and hit “Tab” on your keyboard. Your command line should now look like the following “ls /usr/local/Cellar/”.
  6. Hit “Tab” two more times and hit enter.
  7. Click “Control D” on your keyboard.
  8. Type “sudo ln /usr/local/Cellar/mtr/0.87/sbin/mtr /usr/local/bin/mtr” in the command line and press enter.
  9. This should return “File exists”.MTR_7.gif
  10. Please refer back to Step 12 in the install directions.

 

 B. “Command not found” error when attempting “sudo mtr”: Updating the PATH environment variable for MTR 0.92. (These are case Sensitive commands)

  1. Locate the installation directory for the mtr and mtr-packet executables.  These will typically reside in the /usr/local/Cellar/mtr/0.92/sbin directory.  Confirm this by using the command “cd /usr/local/”, followed by “ls” to list the contents of the directory.  Use “cd <directory>" iteratively until you navigate through available sub-directories until you reach a point where the directory contents are just mtr and mtr-packet. You can use the “pwd” command to show the full directory path to your current location.Screen_Shot_2019-04-19_at_4.30.46_PM.png
  2. The reason why “Command not found” may be returned when attempting “sudo mtr” is that the PATH environment variable for your terminal does not include the installation directory named in Step 1 above.  The PATH environment variable defines the list of directories in your file system to look in for appropriate executable files to run. The PATH environment variable can be updated and additional directories listed in a terminal session profile file called .bash_profile.  Look for this file when you first bring up a terminal session by issuing the command  “ls -al | grep bash_profile”. Look at the contents of the file by issuing the command “cat .bash_profile”. We will want to update any configuration line in the .bash_profile file which defines the PATH environment variable.Screen_Shot_2019-04-19_at_4.33.33_PM.png
  3. Use the text editor of your choice to edit the .bash_profile file.  Update the PATH definition line to include the installation directory you found in Step 1.  Use a colon (:) to separate the directory you are adding from other directory listings in the definition line. The definition line in the example below says that the new value of the PATH environment variable should include /usr/local/Cellar/mtr/0.92/sbin, /opt/local/bin, /opt/local/sbin, and any existing value of PATH. Screen_Shot_2019-04-19_at_4.37.09_PM.png
  4. If the .bash_profile file does not exist already, you can create the file by issuing the command “touch .bash_profile” to create the file.  Edit the new .bash_profile file using your preferred text editor, and use the definition “export PATH="/usr/local/Cellar/mtr/0.92/sbin:$PATH" to update the PATH environment variable.
  5. After completing the steps above, each time you bring up a terminal session the PATH environment variable will include the installation directory for the mtr and mtr-packet executables. You should no longer generate the “Command not found” error when attempting to use “sudo mtr”.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.