Posts

Showing posts from February, 2019

mac 安裝 mtr

Image
macOS 上要安裝 mtr 看似簡單 $ brew install mtr 如果沒安裝過 HomeBrew 請參考這邊 mtr 可拿來檢查點對點中間的網路狀態 它結合 ping 及 traceroute 的功能 已內建於大多數的 Linux 中 詳細的說明可參考這邊 但這邊有個坑 由於安裝好的 mtr 不在 /usr/local/sbin 中 macOS 中也不存在這這個目錄(macOS 10.14.3) 所以會出現以下的錯誤 Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink sbin/mtr /usr/local/sbin is not writable. You can try again using: brew link 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 mtr 會出現 Linking /usr/local/Cellar/mtr/0.92… Error: Could not symlink sbin/mtr /usr/local/sbin is not writable. 如何設定 1. 建立目錄及設定權限 sudo mkdir /usr/local/sbin && sudo chmod ug+rwx /usr/local/sbin && sudo chown $(id -un):admin /usr/local/sbin 2. 設定 PATH 如果有裝 zsh 的話 請編輯 vi .zshrc 如果沒有使用 zsh 請編輯 vi .bash_profile 將下面的部分貼到最下方 export PA