Install recent ImageMagick on CentOS 6.3

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).