NothingToSeeHere
NothingToSeeHere

Reputation: 2363

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

I inherited a computer that apparently had installed Imagemagick with something other than homebrew. when I run brew doctor I get these warnings:

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

then:

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

so then I keep doing what they suggest...but I can't seem to remove these file.

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$  

I have successfully installed ImageMagick before on other machines...but I just don't know what's going on here

Upvotes: 0

Views: 1122

Answers (1)

emcconville
emcconville

Reputation: 24439

This is more a comment than an answer, but ran too long for SO format.

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

Can you identify where the previous source files are on the machine? Usually if the previous owner followed the basic GNU install methods (i.e. configure, make, & make install), all you have to do is cd into the build directory, and type sudo make uninstall.

If the previous build files can not be found, you can still uninstall, but you have to download source that matches what's installed.

 identify -version

Which should print out something like Version: ImageMagick 6.8.5-10 2013-07-08 Q16 ....

Jump over to http://imagemagick.org/download/releases/ and find the version that matches what's installed on your machine.

# 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

Note: ImageMagick is a complex ecosystem with utilities, documents, libraries, and supporting run-time artifacts. Attempting to manually remove shared libraries may introduce additional problems down the road. GNU autotools should handle this for you.

Upvotes: 2

Related Questions