Install recent ImageMagick on CentOS 6.3

16,256

Solution 1

You shouldn't be having these problems... I tried to search for nice, canned binaries of a current version of ImageMagick. I couldn't find any that didn't have odd prerequisites...

So I spun up a CentOS 6.3 virtual machine and built the newest ImageMagick SRPM file. You may want to enable the RepoForge repository (formerly RPMForge) as well. The build went without a hitch!

System information:

[root@MDMarra ~]# uname -a
Linux MDMarra.localdomain 2.6.32-279.11.1.el6.x86_64 #1 SMP Tue Oct 16 15:57:10 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

[root@MDMarra ~]# cat /etc/issue
CentOS release 6.3 (Final)
Kernel \r on an \m

[root@MDMarra ~]# yum repolist
repo id                                       repo name                                                     status
base                                          CentOS-6 - Base                                                 6346
extras                                        CentOS-6 - Extras                                                  6
rpmforge                                      Red Hat Enterprise 6 - RPMforge.net - dag                       4453
update                                        CentOS-6 - Updates                                               820

Begin the installation:

[root@MDMarra ~]# wget http://imagemagick.mirrorcatalogs.com/linux/SRPMS/ImageMagick-6.8.0-4.src.rpm
[root@MDMarra ~]# yum install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel OpenEXR-devel
[root@MDMarra ~]# rpmbuild --rebuild ImageMagick-6.8.0-4.src.rpm

These files were generated:

Processing files: ImageMagick-debuginfo-6.8.0-4.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/ImageMagick-6.8.0-4.x86_64
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-devel-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-djvu-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-doc-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-perl-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-c++-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-c++-devel-6.8.0-4.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/ImageMagick-debuginfo-6.8.0-4.x86_64.rpm

Install the package:

rpm -ivh /root/rpmbuild/RPMS/x86_64/ImageMagick-6.8.0-4.x86_64.rpm 

Check installed binaries:

[root@MDMarra ~]# rpm -qlp /root/rpmbuild/RPMS/x86_64/ImageMagick-6.8.0-4.x86_64.rpm| grep bin
/usr/bin/animate
/usr/bin/compare
/usr/bin/composite
/usr/bin/conjure
/usr/bin/convert
/usr/bin/display
/usr/bin/identify
/usr/bin/import
/usr/bin/mogrify
/usr/bin/montage
/usr/bin/stream

Check the newly-installed package version number:

[root@MDMarra ~]# /usr/bin/convert -version
Version: ImageMagick 6.8.0-4 2012-11-07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP    

Enjoy!!

Solution 2

Since nobody mentioned a "hassle-free" alternative, I'm going to add a new answer.

If you don't mind using non-official repositories, you can enable the Remi repo as described here http://blog.famillecollet.com/pages/Config-en. After that, just type

yum install ImageMagick-last.x86_64 ImageMagick-last-devel.x86_64

And you'll get one of the latest versions available, already packaged and with every dependency correctly resolved and handled by yum. No need to recompile anything.

Note: It's not exactly up to date with the version you can find on the official website, but it seems to be no more than 1-2 months behind. For example, at the time of writing the latest official version is 6.8.8 (Jan 12, 2014) while the one I found on the remi repo is 6.8.7 (Dec 15, 2013).

Solution 3

I had this problem with CentOS 7.2 and ImageMagick 6.9.3-9. After much trial and error I discovered that 6.9.3-8 works, while 6.9.3-9 has dependencies that fail to resolve. Fortunately http://rpm.pbone.net/ found a repository with the older version.

IMAGEMAGICK_VERSION=6.9.3-8
# Be warned, 6.9.3-9 does not work; dependencies fail to resolve
IMAGEMAGICK_LIBS_SHA1=c0919e4ef4b7edc1052ef40eef4cc34f7a86341c
IMAGEMAGICK_SHA1=f99eda483850dd116b08e5527d603be2a47db8c4

curl -O ftp://ftp.icm.edu.pl/vol/rzm4/ImageMagick/linux/CentOS/x86_64/ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.rpm \
    && sha1sum ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.rpm | grep $IMAGEMAGICK_LIBS_SHA1 \
    && yum install -y ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.rpm \
    && rm ImageMagick-libs-$IMAGEMAGICK_VERSION.x86_64.rpm \
    && curl -O ftp://ftp.icm.edu.pl/vol/rzm4/ImageMagick/linux/CentOS/x86_64/ImageMagick-$IMAGEMAGICK_VERSION.x86_64.rpm \
    && sha1sum ImageMagick-$IMAGEMAGICK_VERSION.x86_64.rpm | grep $IMAGEMAGICK_SHA1 \
    && yum install -y ImageMagick-$IMAGEMAGICK_VERSION.x86_64.rpm \
    && rm ImageMagick-$IMAGEMAGICK_VERSION.x86_64.rpm
Share:
16,256

Related videos on Youtube

organicveggie
Author by

organicveggie

Updated on September 18, 2022

Comments

  • organicveggie
    organicveggie over 1 year

    I'm having a terrible time trying to get a recent version of ImageMagick installed on a CentOS 6.3 x86_64 server. First, I [downloaded] 1 the RPM from the ImageMagick site and tried to install it. That failed due to missing dependencies:

    error: Failed dependencies:
        libHalf.so.4()(64bit) is needed by ImageMagick-6.8.0-4.x86_64
        libIex.so.4()(64bit) is needed by ImageMagick-6.8.0-4.x86_64
        libIlmImf.so.4()(64bit) is needed by ImageMagick-6.8.0-4.x86_64
        libImath.so.4()(64bit) is needed by ImageMagick-6.8.0-4.x86_64
        libltdl.so.3()(64bit) is needed by ImageMagick-6.8.0-4.x86_64
    

    I have libtool-ltdl installed, but that includes libltdl.so.7, not libltdl.so.4. I have a similar problem with libHalf, libIex, libIlmImf and libImath. Typically, you can install OpenEXR to get those dependencies. Unfortunately, CentOS 6.3 includes OpenEXR 1.6.1, which includes ilmbase-devel 1.0.1. And that release of ilmbase-devel includes newer versions of those dependencies:

    • libHalf.so.6
    • libIex.so.6
    • libIlmImf.so.6
    • libImath.so.6

    I next tried following the [instructions] 2 for installing ImageMagick from source. No luck there either. I get a build error:

    RPM build errors:
      File not found by glob: /home/sean/rpmbuild/BUILDROOT/ImageMagick-6.8.0-4.x86_64/usr/lib64/ImageMagick-6.8.0/modules-Q16/coders/djvu.*
    

    I even re-ran configure to explicitly exclude djvu and I still get the same error. At this point, I'm pulling my hair out.

    What's the easiest way to get a relatively recent version of ImageMagick (> 6.7) installed on CentOS 6.3? Does someone offer RPMs with dependencies somewhere?

    • user16081-JoeT
      user16081-JoeT over 11 years
      I had trouble with this too, not sure if I ever got it to work but you might try: 'yum install libtool-ltdl-devel'
    • organicveggie
      organicveggie over 11 years
      In CentOS 6.3, libtool-ltdl-devel includes libltdl.so.7, but ImageMagick requires libltdl.so.3. :(
    • user16081-JoeT
      user16081-JoeT over 11 years
      I wonder if they are similar enough that you could create symlinks from .3 to .7 and fake out ImageMagick so it installs. total hack move but it might work :\
  • organicveggie
    organicveggie over 11 years
    I'll update my post to clarify, but I already went down that path. CentOS 6.3 has OpenEXR 1.6.1, which includes newer versions of things like libHalf (libHalf.so.6 for example).
  • organicveggie
    organicveggie over 11 years
    Hrmmm. Interesting. I didn't install djvulibre-devel, libwmf-devel, jasper-devel or giflib-devel when trying to rebuild the RPM. Lemme give that a shot.
  • ewwhite
    ewwhite over 11 years
    The list of *-devel packages needed to build the RPM were listed in the error I received when I initially ran rpmbuild against the SRPM. I could also just upload the resulting file... But I wanted to outline the steps I took.
  • organicveggie
    organicveggie over 11 years
    See, I mistakenly followed the instructions that told me to rebuild the SRPM first. Somehow that step let me skip the checks for missing RPMs when running rpmbuild. Weird. Installing the missing RPMs did the trick! I was able to build the final RPMs and install them without a hitch. Testing showed the binaries worked perfectly. Thanks!
  • organicveggie
    organicveggie over 11 years
    Of course, I wish there were pre-built binaries for CentOS, but that's another story... :)
  • MDMarra
    MDMarra over 11 years
    WHY ARE YOU SSHed INTO ME? This is really awkward.
  • Scott Pack
    Scott Pack over 11 years
    @MDMarra: You're about to get married. Be thankful for any action.
  • Synxmax
    Synxmax about 11 years
    You are my hero thanks really , i did installed ImageMagick 6.8.3-6 2013-03-05 Q16 with your steps , how can i add it to php ? Thanks in advance
  • Ben
    Ben over 9 years
    @ewwhite Have you tried the method with OpenJPEG?
  • user56reinstatemonica8
    user56reinstatemonica8 almost 8 years
    Or you can download from remi repo as a one-off with sudo yum --enablerepo=remi install ImageMagick-last.x86_64 ImageMagick-last-devel.x86_64