已安装Brew,已链接但未找到


12

我只是mtr通过Homebrew 安装的,它似乎成功完成了(即没有异常)。

MBA% mtr
zsh: command not found: mtr

真奇怪 我想我会再试一次:

MBA% brew install mtr
Warning: mtr-0.86 already installed

好吧,也许它被符号链接为mtr-0.86

MBA% mtr-0.86
zsh: command not found: mtr-0.86

不,好的,也许只是链接失败:

MBA% brew link mtr
Warning: Already linked: /usr/local/Cellar/mtr/0.86
To relink: brew unlink mtr && brew link mtr
MBA% brew unlink mtr && brew link mtr
Unlinking /usr/local/Cellar/mtr/0.86... 3 symlinks removed
Linking /usr/local/Cellar/mtr/0.86... 2 symlinks created
MBA% mtr zsh: command not found: mtr

然而:

MBA% /usr/local/Cellar/mtr/0.86/sbin/mtr
[Success]

这是怎么回事?为什么Homebrew无法链接(为此,在重新链接时创建的符号链接更少。)?


1
(敏锐的注意可能mtr需要根源。是的。[成功]我的意思是它抱怨的只是这个问题,而不是没有参加。)
OJFord

Answers:


14

安装brew 0.86时,我看到了相同的内容。尽管大多数二进制文件都链接到/ usr / local / bin,但brew链接到/ usr / local / sbin。绝对正确,但是您需要扩展路径以避免输入整个路径。

export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"

会修复一次,您需要调整.bash_profile才能永久修复


它会帮助一次
antiqe

12

对于MTR v0.86及以下版本:

brew install mtr
ln /usr/local/Cellar/mtr/0.86/sbin/mtr /usr/local/bin/mtr
sudo mtr superuser.com

但由于mtr v0.87,还需要一个命令:

ln /usr/local/Cellar/mtr/0.92/sbin/mtr-packet /usr/local/bin/mtr-packet

实际上mtr已经在/ usr / local / sbin中。将/ usr / local / sbin添加到PATH的解决方案更好。
Tuanitim
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.