如何在不破坏我的系统的情况下设置Homebrew?

时间:2014-12-31 14:02:27

标签: homebrew

屈服于压力,我已经安装了Homebrew并给它一个旋转。但到目前为止,我对这次经历感到惊讶。我对Homebrew的印象是它是OS X易于使用,安全且独立的包管理器。但这不是我的经验。

(1)它做的第一件事就是在一些可怕的目录上改变一堆权限:

    ==> The following directories will be made group writable:
    /usr/local/.
    /usr/local/bin
    /usr/local/include
    /usr/local/lib
    /usr/local/lib/pkgconfig
    /usr/local/share
    /usr/local/share/man
    /usr/local/share/man/man1
    /usr/local/share/man/man3
    /usr/local/share/man/man7
    /usr/local/share/info
    /usr/local/share/doc
    ==> The following directories will have their group set to admin:
    /usr/local/.
    /usr/local/bin
    /usr/local/include
    /usr/local/lib
    /usr/local/lib/pkgconfig
    /usr/local/share
    /usr/local/share/man
    /usr/local/share/man/man1
    /usr/local/share/man/man3
    /usr/local/share/man/man7
    /usr/local/share/info
    /usr/local/share/doc

(2)它接下来要做的事情(按照建议的程序运行brew doctor)要求我删除一大堆可怕的文件:

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/share/ghostscript/9.05/Resource/Font/blex.pfb
  [hundreds...]

Warning: Unbrewed dylibs 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 dylibs:
    /usr/local/lib/libasan.1.dylib
    /usr/local/lib/libasan.2.dylib
    /usr/local/lib/libatomic.1.dylib
    /usr/local/lib/libcdt.5.dylib
    /usr/local/lib/libcgraph.6.dylib
    /usr/local/lib/libcilkrts.5.dylib
    /usr/local/lib/libgcc_ext.10.4.dylib
    /usr/local/lib/libgcc_ext.10.5.dylib
    /usr/local/lib/libgcc_s.1.dylib
    /usr/local/lib/libgcc_s.10.4.dylib
    /usr/local/lib/libgcc_s.10.5.dylib
    /usr/local/lib/libgfortran.2.0.0.dylib
    /usr/local/lib/libgfortran.3.dylib
    /usr/local/lib/libgmp.10.dylib
    /usr/local/lib/libgmpxx.4.dylib
    /usr/local/lib/libgomp.1.dylib
    /usr/local/lib/libgvc.6.dylib
    /usr/local/lib/libgvpr.2.dylib
    /usr/local/lib/libitm.1.dylib
    /usr/local/lib/liblkdynam.dylib
    /usr/local/lib/liblkrealt.dylib
    /usr/local/lib/liblksec.dylib
    /usr/local/lib/liblksock.dylib
    /usr/local/lib/libmpc.3.dylib
    /usr/local/lib/libmpfr.4.dylib
    /usr/local/lib/libpathplan.4.dylib
    /usr/local/lib/libquadmath.0.dylib
    /usr/local/lib/libssp.0.dylib
    /usr/local/lib/libstdc++.6.dylib
    /usr/local/lib/libtcl8.6.dylib
    /usr/local/lib/libtk8.6.dylib
    /usr/local/lib/libubsan.0.dylib
    /usr/local/lib/libxdot.4.dylib

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/c++/5.0.0/backward/auto_ptr.h
    [hundreds...]

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

(3)无法安装,例如,尝试安装matplotlib-basemap给我

==> Installing matplotlib-basemap from homebrew/homebrew-python
==> Installing dependencies for matplotlib-basemap: numpy, pkg-config, libpng, freetype, matplotlib, jpeg, libtiff, little-cms2, webp, pillow
==> Installing matplotlib-basemap dependency: numpy
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://downloads.sourceforge.net/project/numpy/NumPy/1.9.1/numpy-1.9.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/numpy-1.9.1.tar.gz
==> Patching
==> python setup.py build --fcompiler=gnu95 install --prefix=/usr/local/Cellar/numpy/1.9.1
  File "/private/tmp/numpy-PSE07t/numpy-1.9.1/numpy/distutils/fcompiler/gnu.py", line 197, in get_flags_opt
    v = self.get_version()
  File "/private/tmp/numpy-PSE07t/numpy-1.9.1/numpy/distutils/fcompiler/__init__.py", line 434, in get_version
    raise CompilerNotFound()
numpy.distutils.fcompiler.CompilerNotFound
couldn't understand kern.osversion `14.0.0'

即使我已经安装了ScyPy堆栈并且gfortran已经安装并正常工作。

有没有办法解决这个烂摊子?我如何从一个工作配置(site-packages中使用pip维护的Xcode,Python,Python包等)到一个也使用Homebrew(并继续工作)的配置?我是否真的需要遵循博士的所有建议并删除所有这些文件才能继续;这样做是否安全?

1 个答案:

答案 0 :(得分:1)

您展示的问题并不表示一般性问题。

  1. Homebrew“接管”/usr/local/的事实是一个记录完备的设计决策。起初它可能是“可怕的”,但它对每个人都有效。如果你真的想这样做,可以将Homebrew安装到不同的目录中。

  2. 如果您在brew doctor下安装了现有的非酿造软件,则
  3. /usr/local/警告也是正常的。请注意,这些警告说明了一些问题,如果您遇到问题,这些可能是原因。它没有说,在做任何其他事情之前删除所有这些文件。 (关于这个问题的SO有很多问题)

  4. 和4.只是运气不好AFAICT。这些都是有点偏僻的路径包,因此他们现在可能会遇到一些问题。

  5. 如果您可以安装主流软件包,我不知道,git或make或lynx,那么一切都很好,您只需要解决各个软件包的问题。