无法在 OSX Yosemite 上移除、删除或自制 link ImageMagick

Can't remove, delete or homebrew link ImageMagick on OSX Yosemite

我继承了一台显然安装了 Imagemagick 的计算机,而不是自制软件。当我 运行 brew doctor 我收到这些警告:

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/libMagick++-6.Q16.6.dylib
    /usr/local/lib/libMagickCore-6.Q16.2.dylib
    /usr/local/lib/libMagickWand-6.Q16.2.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/ImageMagick-6/magick/accelerate.h
    /usr/local/include/ImageMagick-6/magick/animate.h
    #huge list redacted

然后:

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:

    imagemagick
Macbook: fred$ brew link imagemagick
Linking /usr/local/Cellar/imagemagick/6.9.1-10... 
Error: Could not symlink etc/ImageMagick-6/coder.xml
Target /usr/local/etc/ImageMagick-6/coder.xml
already exists. You may want to remove it:
  rm '/usr/local/etc/ImageMagick-6/coder.xml'

To force the link and overwrite all conflicting files:
  brew link --overwrite imagemagick


Macbook: fred$ rm /usr/local/etc/ImageMagick-6/coder.xml
override rw-r--r--  root/admin for /usr/local/etc/ImageMagick-6/coder.xml? y
rm: /usr/local/etc/ImageMagick-6/coder.xml: Permission denied

所以我继续按照他们的建议做...但我似乎无法删除这些文件。

Macbook: fred$        brew link --overwrite imagemagick
Linking /usr/local/Cellar/imagemagick/6.9.1-10... 
Error: Could not symlink etc/ImageMagick-6/coder.xml
/usr/local/etc/ImageMagick-6 is not writable.
Macbook: fred$  

我以前在其他机器上成功安装过 ImageMagick...但我只是不知道这里发生了什么

这是评论而不是答案,但是 运行 对于 SO 格式来说太长了。

I inherited a computer that apparently had installed Imagemagick with something other than homebrew.

你能确定机器上以前的源文件在哪里吗?通常,如果前任所有者遵循基本的 GNU 安装方法(即 configuremake、& make install),您所要做的就是 cd 进入构建目录,然后输入 sudo make uninstall.

如果找不到以前的构建文件,您仍然可以卸载,但您必须下载与已安装内容匹配的源。

 identify -version

应该打印出类似 Version: ImageMagick 6.8.5-10 2013-07-08 Q16 ....

的内容

跳转到 http://imagemagick.org/download/releases/ 并找到与您计算机上安装的版本相匹配的版本。

# Download & extract (YMMV)
curl -O http://imagemagick.org/download/releases/ImageMagick-6.8.5-10.tar.xz
tar xfJ ImageMagick-6.8.5-10.tar.xz
cd ImageMagick-6.8.5-10

# Configure source, and be sure that default `Q16` matches.
./configure

# Uninstall
sudo make uninstall

注意:ImageMagick 是一个复杂的生态系统,包含实用程序、文档、库和支持 运行 时代的工件。尝试手动删除共享库可能会在以后引入其他问题。 GNU autotools 应该会为您处理。