Macos 如何修复Mac OSX 10.9上的“brew doctor”错误(未找到酒窖中未链接的小桶和自制sbin)?

Macos 如何修复Mac OSX 10.9上的“brew doctor”错误(未找到酒窖中未链接的小桶和自制sbin)?,macos,homebrew,package-managers,Macos,Homebrew,Package Managers,我正在尝试解决brew的一些问题。当前运行brew doctor时,我得到以下输出: Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: aut

我正在尝试解决brew的一些问题。当前运行
brew doctor
时,我得到以下输出:

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

    autoconf
    libevent

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
    echo export PATH="/usr/local/sbin:$PATH" >> ~/.bash_profile
所以我继续尝试所有的建议。第一个
brew链接自动功能
,其结果是:

Linking /usr/local/Cellar/autoconf/2.69... Warning: Could not link autoconf. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/autoconf/2.69/share/emacs/site-lisp/autotest-mode.elc
Target /usr/local/share/emacs/site-lisp/autotest-mode.elc already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
  brew link --overwrite formula_name

To list all files that would be deleted:
  brew link --overwrite --dry-run formula_name
因此,我再次尝试了建议的命令:
brew link--overwrite autoconf

Linking /usr/local/Cellar/autoconf/2.69... Warning: Could not link autoconf. Unlinking...

Error: Permission denied - /usr/local/share/emacs/site-lisp/autotest-mode.elc
我对被拒绝的
权限的最初反应通常是在其前面加上
sudo
,这导致brew告诉我:
错误:怯懦地拒绝
sudo-brew链接`

尝试
brew link libevent
时,我得到的结果与
brew link autoconf
相同

最后,我尝试通过运行建议的
echo导出路径=“/usr/local/sbin:$PATH”>~/.bash\u profile
来解决找不到的sbin。运行时不会出错,但当我再次运行
brew doctor
时,仍会显示该消息


有人知道我如何解决这些问题吗?欢迎所有提示

您可能希望在/usr/local/share/emacs/site lisp/autotest-mode.elc上使用chmod更改写入权限

在此之后,您应该得到如下内容:
链接/usr/local/ceral/autoconf/2.69。。。创建了21个符号链接这里的一般问题是,autoconf和libevent已经安装在您的系统上,它们也在您的自制“酒窖”中。因此,系统上有两个autoconf副本,系统上有两个libevent副本

homebrew正在尝试删除这些库的先前安装(系统范围)版本,并用homebrew Cell中的符号链接替换所有相关的真实文件。这将使homebrew能够完全控制这些库的升级和管理。它还将为您提供两个位置的这些库的一个副本

问题是homebrew没有unix权限删除这些真实文件,您需要自己完成。以下是autoconf的使用方法:

$ sudo rm /usr/local/share/emacs/site-lisp/autotest-mode.elc
$ sudo chmod 777 /usr/local/share/emacs/site-lisp/
$ sudo rm -rf /usr/local/share/autoconf
$ brew link --overwrite autoconf
你应该看到:

链接/usr/local/ceral/autoconf/2.69。。。已创建21个符号链接

更新我刚刚注意到关于sbin的部分。我不确定这个问题最初是如何发生的,但我可以解释如何解决它

自制软件(ECHO…)推荐的修复程序仅在下次登录Mac时生效。要使此更改立即生效,您必须强制终端重新读取.bash_配置文件。运行自制的ECHO命令后,只需
$source~/.bash_profile


由于此问题已经提出几个月了,您可能已经发现此错误消息已消失。

运行以下命令以授予权限:

$ sudo chown -R $(whoami) /usr/local
一旦授予特权,现在必须将其链接,因为它已经安装:

$ brew link autoconf
$ brew link libevent

sudo rm/usr/local/share/emacs/site lisp/autotest-mode.elc。。。我猜接下来是取消链接的过程。在自定义权限并重新链接后,我是否要恢复权限中的更改?回归的命令是什么?
sudo chown-R$(whoami)/usr/local
在莫哈韦不再有效。看。@Hahnemann也许你不能在
/usr/local
上,但你可以在里面的任何其他文件夹中。昨天,我能够在brew之前运行以下命令在Mojave重新安装Python:
sudo mkdir-p/usr/local/Frameworks
,然后
sudo chown-R$(whoami)/usr/local/Frameworks
。在中引用。