我看到的 Brew Doctor 警告是否有明显来源?

Are there obvious sources for the Brew Doctor warnings I'm seeing?

我最近在 Yosemite 上安装了 Hombrew,并安装了 Xcode,我想更好地了解 brew doctor 警告我的内容。我知道这些警告是 nothing to worry about (until they are) 并且我不是在询问如何或是否回应它们;但我想尽我所能了解可能的原因,以便在出现问题时做好准备(并避免我办公室的其他人在类似系统上可能遇到的问题)。

以下任何项目是否来自安装了 Xcode 和非 brew Fortran 的 10.10 机器上的明显来源?这些项目中的任何一项是否响铃?

Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1
    /usr/local/share/man/mann

Warning: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/lib/libasan.dylib
  /usr/local/lib/libatomic.dylib
  /usr/local/lib/libcilkrts.dylib
  /usr/local/lib/libgcc_s_ppc64.1.dylib
  /usr/local/lib/libgcc_s_x86_64.1.dylib
  /usr/local/lib/libgfortran.dylib
  /usr/local/lib/libgmp.dylib
  /usr/local/lib/libgmpxx.dylib
  /usr/local/lib/libgomp.dylib
  /usr/local/lib/libitm.dylib
  /usr/local/lib/libmpc.dylib
  /usr/local/lib/libmpfr.dylib
  /usr/local/lib/libquadmath.dylib
  /usr/local/lib/libssp.dylib
  /usr/local/lib/libstdc++.dylib
  /usr/local/lib/libubsan.dylib
  /usr/local/lib/ppc64/libgfortran.2.0.0.dylib
  /usr/local/lib/ppc64/libgfortran.2.dylib
  /usr/local/lib/ppc64/libgfortran.dylib
  /usr/local/lib/x86_64/libgfortran.2.0.0.dylib
  /usr/local/lib/x86_64/libgfortran.2.dylib
  /usr/local/lib/x86_64/libgfortran.dylib

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

  /opt/ImageMagick/bin/Magick++-config
  /opt/ImageMagick/bin/Magick-config
  /opt/ImageMagick/bin/MagickCore-config
  /opt/ImageMagick/bin/MagickWand-config
  /opt/ImageMagick/bin/Wand-config

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
    /usr/local/include/fakemysql.h
    /usr/local/include/fakepq.h
    /usr/local/include/fakesql.h
    /usr/local/include/gmp.h
    /usr/local/include/gmpxx.h
    /usr/local/include/graphviz/arith.h
    /usr/local/include/graphviz/cdt.h
    /usr/local/include/graphviz/cgraph.h
    /usr/local/include/graphviz/color.h
    /usr/local/include/graphviz/geom.h
    /usr/local/include/graphviz/graphviz_version.h
    /usr/local/include/graphviz/gvc.h
    /usr/local/include/graphviz/gvcext.h
    /usr/local/include/graphviz/gvcjob.h
    /usr/local/include/graphviz/gvcommon.h
    /usr/local/include/graphviz/gvconfig.h
    /usr/local/include/graphviz/gvplugin.h
    /usr/local/include/graphviz/gvplugin_device.h
    /usr/local/include/graphviz/gvplugin_layout.h
    /usr/local/include/graphviz/gvplugin_loadimage.h
    /usr/local/include/graphviz/gvplugin_render.h
    /usr/local/include/graphviz/gvplugin_textlayout.h
    /usr/local/include/graphviz/gvpr.h
    /usr/local/include/graphviz/pack.h
    /usr/local/include/graphviz/pathgeom.h
    /usr/local/include/graphviz/pathplan.h
    /usr/local/include/graphviz/textspan.h
    /usr/local/include/graphviz/types.h
    /usr/local/include/graphviz/usershape.h
    /usr/local/include/graphviz/xdot.h
    /usr/local/include/itcl.h
    /usr/local/include/itcl2TclOO.h
    /usr/local/include/itclDecls.h
    /usr/local/include/itclInt.h
    /usr/local/include/itclIntDecls.h
    /usr/local/include/itclMigrate2TclCore.h
    /usr/local/include/itclTclIntStubsFcn.h
    /usr/local/include/mpc.h
    /usr/local/include/mpf2mpfr.h
    /usr/local/include/mpfr.h
    /usr/local/include/mysqlStubs.h
    /usr/local/include/odbcStubs.h
    /usr/local/include/pqStubs.h
    /usr/local/include/tcl.h
    /usr/local/include/tclDecls.h
    /usr/local/include/tclOO.h
    /usr/local/include/tclOODecls.h
    /usr/local/include/tclPlatDecls.h
    /usr/local/include/tclThread.h
    /usr/local/include/tclTomMath.h
    /usr/local/include/tclTomMathDecls.h
    /usr/local/include/tdbc.h
    /usr/local/include/tdbcDecls.h
    /usr/local/include/tdbcInt.h
    /usr/local/include/tk.h
    /usr/local/include/tkDecls.h
    /usr/local/include/tkPlatDecls.h

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libasan.la
    /usr/local/lib/libatomic.la
    /usr/local/lib/libcilkrts.la
    /usr/local/lib/libgfortran.la
    /usr/local/lib/libgmp.la
    /usr/local/lib/libgmpxx.la
    /usr/local/lib/libgomp.la
    /usr/local/lib/libitm.la
    /usr/local/lib/libmpc.la
    /usr/local/lib/libmpfr.la
    /usr/local/lib/libquadmath.la
    /usr/local/lib/libssp.la
    /usr/local/lib/libssp_nonshared.la
    /usr/local/lib/libstdc++.la
    /usr/local/lib/libsupc++.la
    /usr/local/lib/libubsan.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/libcdt.pc
    /usr/local/lib/pkgconfig/libcgraph.pc
    /usr/local/lib/pkgconfig/libgvc.pc
    /usr/local/lib/pkgconfig/libgvpr.pc
    /usr/local/lib/pkgconfig/libpathplan.pc
    /usr/local/lib/pkgconfig/libxdot.pc
    /usr/local/lib/pkgconfig/tcl.pc
    /usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
    /usr/local/lib/libatomic.a
    /usr/local/lib/libcilkrts.a
    /usr/local/lib/libgfortran.a
    /usr/local/lib/libgmp.a
    /usr/local/lib/libgmpxx.a
    /usr/local/lib/libgomp.a
    /usr/local/lib/libitm.a
    /usr/local/lib/libmpc.a
    /usr/local/lib/libmpfr.a
    /usr/local/lib/libquadmath.a
    /usr/local/lib/libssp.a
    /usr/local/lib/libssp_nonshared.a
    /usr/local/lib/libstdc++.a
    /usr/local/lib/libsupc++.a
    /usr/local/lib/libtclstub8.6.a
    /usr/local/lib/libtkstub8.6.a

这里有各种各样的警告,可能都有一个非常相似的原因:从源代码安装软件(通过 configure; make; make install 编译,或者有时解压一个非常具体的(例如科学的)包,例如语言)。那将主要是具有 unix 背景的软件,并且该软件决定将自身安装在 /usr/local 中。

我不知道你的背景,所以我要展开一些(我可能会遗漏一些东西或者可能有一些东西(有点)不正确):

在 unix 和 linux 中,一个软件通常分布在各个子目录中,而不是在一个包中(这更像是 Mac 风格)。它可以包含进入 /usr/local/bin/ 的二进制文件,一个包含放入 /usr/local/lib/ 的二进制文件使用的例程的库,一些位于 /usr/local/include/ 中的函数声明的头文件,一个手册页放在 /usr/local/man/ 中或可以进入 /usr/local/share/ 的其他(例如配置)数据。实际上任何组合都可以存在。

这看起来有点分散,但它确实有效。这确实意味着不同的软件位于同一个子目录中,正如您可以从各种文件名列表中看到的那样。

请注意 /usr/local/ 到目前为止是唯一的,它往往是安装 extra 软件的首选目录:系统 (OS) 可以不用。这也是 Homebrew 喜欢把软件安装在那里的原因。其他软件管理器避免 unix 默认的 /usr/local/ 并安装在 /opt/local/ (Macports) 或 /sw/ (Fink)。但 Homebrew 选择默认 "extra" 软件安装部分的事实可能意味着它与其他已安装的软件发生冲突。

您的系统软件存在于 /usr//System//Library/ 中,远离 /usr/local/;如果您完全删除 /usr/local/,您的系统仍然可以工作。

因此,考虑到这一点,警告:

Warning: Some directories in /usr/local/share/man aren't writable. This can happen if you "sudo make install" software that isn't managed by Homebrew. If a brew tries to add locale information to one of these directories, then the install will fail during the link step. You should probably chown them:

/usr/local/share/man/de
/usr/local/share/man/de/man1
/usr/local/share/man/mann

其他软件在此处安装其手册页,可能使用 sudo 命令(您可能只是有一个对话框询问您的密码;sudo 然后在幕后发生)。在那种情况下,这些特定目录是 "owned" by "root",而不是通常的 Homebrew 用户(您的登录名)。这意味着 Homebrew 不能在未来的事件中不写入这些目录,如果它遇到喜欢那里的手册页的软件,因为它不属于 Homebrew 用户。

您可以通过更改自己的权限来缓解此问题:

$ sudo chown -R <user>:<group> /usr/local/share/man/de
$ sudo chown -R <user>:<group> /usr/local/share/man/mann

(做一个 $ ls -l $HOME 来找到你的 <user><group> 来填写:希望这是显而易见的列。)

Warning: Broken symlinks were found. Remove them with `brew prune`:

A sym(bolic )link 只是指向其他地方存在的文件的指针。如果它坏了,原始文件不再存在,或者 symlink 指向错误的地方。您可以通过以下操作查看它指向的内容:

ls -l   /usr/local/lib/libasan.dylib

.dylib 文件都是动态库:包含函数的库文件,旨在供其他程序使用(但具体而言,并未完全包含在该程序中;稍后请参阅静态库) .损坏的库文件可能是一件坏事:想要使用这些文件的新软件可能会认为 "ah, I can use this library" 然后在编译过程中事情变坏,结果发现该文件不再存在。因此,p运行e(删除)符号 links 可能是明智的。 (符号 link 通常可以安全地删除,即使它指向正确:它只是一个指针,原始文件保持不变。)

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

configure 是在命令行上从源代码构建软件链的一部分。它会在您的系统上四处寻找现有的库,并使用这些 -config 脚本询问程序的配置。 Homebrew 环顾四周,在通常的目录之外发现了这样的脚本。因此,configure 可能会找到同一个配置脚本的多个版本,搞不清该用哪个,然后就用错了。

在这种情况下,都是 ImageMagick 的东西。根据您的使用方式,您可以选择删除整个 /opt/ImageMagick/ 目录(也许您会留下一个空的 /opt/ 目录,在这种情况下您也可以删除 /opt/;它不是通常系统的一部分)。

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

这些都是相关的,和前面提到的动态库有关。 .a 文件是静态库:它们(也)包含常用函数,但是当从源代码编译软件时,这些文件会包含在二进制文件中(因此,二进制文件变得比动态库更大)。 .h 文件是头文件,它告诉程序库文件包含什么; .la 有一些关于 .a 库文件的额外信息。

警告告诉您 Homebrew 在安装新软件时可能会感到困惑:也许它会尝试使用这些库,但它们恰好是(哦,有点)错误的版本,所以无法正常工作。不幸的是,直到你碰到它你才知道。

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

pkgconfig 文件类似于前面提到的那些配置脚本:如果您需要一些较早安装的软件来构建新软件,它们包含配置信息。同样,和以前一样:版本可能略有不匹配,然后事情无法按预期工作(它不安装,或崩溃,或使您的计算机通过图灵测试)。

至于您是如何获得 /usr/local. 中的所有这些文件的?可能您安装了一个将所有内容都放在 /usr/local/ 中的软件包。如前所述,这是放置东西的默认位置。由于它具有libgfortranlibgomp,我倾向于考虑一些科学包。

总而言之,大多数警告都是关于潜在的不兼容性:与大多数 package/software 管理器一样,Homebrew 试图对其安装的内容和周围的内容保持一定的控制(虽然不是太紧),因为向后不兼容这可能意味着新安装的源软件("brewed" 软件)没有正确安装或 运行。例如,Macports 更严格(至少我几年前使用它时是这样),并且会下载匹配的、已知兼容的、所需额外软件的版本(因此,您最终可能会得到四个不同的版本C 编译器)。

Homebrew 试图对已安装的库等保持宽容,但它确实警告您可能会在编译期间或之后发生不好的事情。