The objective is to install ImageMagick 7 on Ubuntu 18.04 Linux.
Operating System and Software Versions
- Operating System: – Ubuntu 18.04 Bionic Beaver Linux
- Software: – ImageMagick 7.0.7-38 or higher
Privileged access to your Ubuntu System as root or via
sudo command is required.
- # – requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ – given linux commands to be executed as a regular non-privileged user
In this article we will be compiling and installing the latest ImageMagick 7 on Ubuntu 18.04 Linux from source code. Firstly, we will install all compilation dependencies, followed by ImageMagick’s source code compilation and subsequent installation.
Lastly, we will perform a check to see whether ImageMagick was installed correctly.
ImageMagick Compilation Dependencies
First step is to install all compilation dependencies. This will allow us to compile ImageMagick. In most cases the installation of the
build-essential package shold be sufficient.
However, I ran into some issues while doing a final installation check. Although installation of the
build-essential package allows for a correct compilation, downloading full dependencies based on Ubuntu’s
imagemagick package seem to be better way to go.
First, enable the source packages within the
/etc/apt/sources.list file by uncommenting
deb-src of Ubuntu’s main repository as shown below:
When ready execute:
$ sudo apt update $ sudo apt build-dep imagemagick
Now it’s time to download the ImageMagick source code.
Download ImageMagick Source files
At this stage we are ready to download and extract the ImageMagick latest source code using the
wget command and extract its content:
$ wget https://www.imagemagick.org/download/ImageMagick.tar.gz $ tar xf ImageMagick.tar.gz $ cd ImageMagick-7*
ImageMagick Compilation and Installation
While still in the ImageMagick’s source code directory execute the
configure command to perform a compilation configuration and to make sure that all compilation dependencies are met:
Next, execute the
make command to perform the compilation:
Lastly, install ImageMagick by executing:
$ sudo make install
The above command will install all previously compiled ImageMagick binaries on your system. Run
ldconfig to link static libraries:
$ sudo ldconfig /usr/local/lib
Confirm installation and final check
Now, we are ready to check the ImageMagick installation. Execute the
indentify command to confirm the installed version:
$ identify -version
Optionaly run more in-depth installation check. Why still in the ImageMagick source code directory execute:
$ make check