简体   繁体   English

brew链接错误libpng和libtiff

[英]brew link error libpng and libtiff

I tried installing elixir using homebrew and I got the following errors 我尝试使用自制软件安装elixir,我收到以下错误

==> Pouring libtiff-4.0.3.yosemite.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local

File exists - /usr/local/lib Error: File exists - /usr/local/lib 文件存在 - / usr / local / lib错误:文件存在 - / usr / local / lib

I ran brew doctor and I saw this 我跑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:

libpng
libtiff

So I ran brew link libpng and I got this 所以我运行brew link libpng ,我得到了这个

Linking /usr/local/Cellar/libpng/1.6.17... Error: File exists - /usr/local/lib

I have no idea whats wrong. 我不知道什么是错的。 Any help 任何帮助

It seems like in your /usr/local/lib folder, there are existing libpng symbols, hence brew doesn't want to overwrite them. 看起来在你的/usr/local/lib文件夹中,有现有的libpng符号,因此brew不想覆盖它们。 It is a dependency of elixir , so it halts the setup. 它是elixir的依赖项,因此它会停止设置。

If you are using MacPorts or Homebrew or installing anything manually, then dependencies might conflict. 如果您使用的是MacPorts或Homebrew或手动安装任何内容,则依赖项可能会发生冲突。 It's better to use one of them in a mutual exclusive way. 最好以互斥的方式使用其中一个。

It's a viable choice to use Homebrew in overall since ease of use, if you are not going to build packages from source. 如果您不打算从源代码构建软件包,那么从易用性开始,使用Homebrew是一个可行的选择。

Homebrew does not work as how you would expect. Homebrew不像你期望的那样工作。 As a default, it has a base directory to install the artifacts of keg s named Cellar , although it is configurable. 默认情况下,它有一个基本目录来安装名为Cellarkeg的工件,尽管它是可配置的。 Normally, you would copy the binaries to the /usr/local/bin , libraries to /usr/local/lib , headers to the /usr/local/include and so on... However, Homebrew installs them to its own directory and creates symbolic links on those directories instead, in order to make them function in same way. 通常,您将二进制文件复制到/usr/local/bin ,将库复制到/usr/local/lib ,将头文件复制到/usr/local/include等等...但是,Homebrew会将它们安装到自己的目录中,相反,在这些目录上创建符号链接,以使它们以相同的方式起作用。

You may find errors (or incompatibities) with brew doctor command. 您可能会发现brew doctor命令出现错误(或不兼容)。 It'll tell you the symbols/files conflicting. 它会告诉你符号/文件冲突。 You can delete them from file system manually, afterwards brew will create the symbolic links pointing to its base directory (upon your brew link $PACKAGE_NAME command). 您可以手动从文件系统中删除它们,然后brew将创建指向其基本目录的符号链接(在您的brew link $PACKAGE_NAME命令时)。

Experiment 实验

When I suddenly decided to do a trivial brew doctor in my computer it did output some unexpected header files like so: 当我突然决定在我的计算机上做一个琐碎的brew doctor ,它输出了一些意想不到的头文件,如下所示:

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.

However, it also states that those are no significance if everything works: 但是,它还指出,如果一切正常,这些并不重要:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

First few lines from the output: 输出的前几行:

Unexpected header files:
  /usr/local/include/node/android-ifaddrs.h
  /usr/local/include/node/ares.h
  ...

This is not my personal computer, but it seems like someone installed node to this computer (actually user) manually. 这不是我的个人计算机,但似乎有人手动将node安装到此计算机(实际上是用户)。 Trying to install it or anything dependent to it via brew would fail, in this case, since the upcoming header files would conflict with pre-installed ones. 在这种情况下,尝试通过brew安装它或依赖于它的任何东西都会失败,因为即将到来的头文件会与预先安装的头文件冲突。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM