JavaEar 专注于收集分享传播有价值的技术资料

Brew linking with ImageMagick

Installing: ostaptan:~ ostap$ brew install imagemagick --disable-openmp --from-source

==> Downloading
Already downloaded: /Library/Caches/Homebrew/imagemagick-6.7.7-6.tar.bz2
==> Patching
patching file configure
Hunk #1 succeeded at 32371 (offset 447 lines).
==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.7-6 --enable-shared --disable-static
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link imagemagick'
==> Summary
/usr/local/Cellar/imagemagick/6.7.7-6: 1388 files, 32M, built in 61 seconds

linking after bad linking in install:

ostaptan:wand ostap$ brew link imagemagick

Linking /usr/local/Cellar/imagemagick/6.7.7-6...

Error: Could not symlink file: /usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/wand/wand-view.h

Target /usr/local/include/ImageMagick/wand/wand-view.h already exists. You may need to delete it.

To force the link and delete this file, do:
  brew link -f formula_name

To list all files that would be deleted:
  brew link -n formula_name

How to link??? what to do?? Can't find answers anywhere!


  1. As suggested in the brew link output, try

    brew link -f imagemagick

    This should clean up old links in /usr/local/include/ImageMagick/, and then link the files required to complete the installation.

    If this doesn't work check that your user has permission to write to /usr/local/include/ImageMagick/*.

  2. 参考答案2
  3. After hours and hours of trying the only thing that worked for me was:

    sudo brew link --overwrite imagemagick

    (Also requires /usr/local/bin/brew to be chowned to root)

  4. 参考答案3
  5. Homebrew does not support the overwrite sudo command anymore.

    sudo brew link --overwrite imagemagick

    Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.