ImageMagick on Ubuntu
Installation

Install ImageMagick on Ubuntu

Sagar Sharma
Sagar Sharma

Table of Contents

Using ImageMagick, you can manipulate images in almost every possible way, and that too by supporting more than 200 image formats!

And being a crucial dependency, ImageMagick comes pre-installed (even on an Ubuntu server) or gets installed as a dependency when you attempt to install packages.

The problem is that the command for using ImageMagick is convert. Many users make the mistake of using imagemagick.

Check if ImageMagick is already installed with this command:

convert --version
check whether you have ImageMagick already installed on your ubuntu system

But for some reason, if it shows an error, you can refer to the following guide to install ImageMagick on Ubuntu.

How to install ImageMagick in Ubuntu

In this guide, I will walk you through 2 ways to install ImageMagick on Ubuntu:

  • Using apt package manager (easy and recommended)
  • Installing it from source (to have the most recent version possible)

So let's start with the first one.

If you don't care about having the latest version and want to get your job in the fastest and easiest way possible, this is for you.

To install ImageMagick using apt, all you have to do is execute the following command:

sudo apt update && sudo apt install imagemagick

Mind the extra k at the end. Many users make mistake and think it is imagmagic.

The above command will update the repository index and get you the latest version of ImageMagick available in the repository.

Once done, you can check the installed version using the following:

convert --version
Check installed version of ImageMagick in Ubuntu

While writing, I got the ImageMagick version 6.9.11.

How to uninstall (avoid it)

🚧
Being a core dependency of multiple packages, removing ImageMagick may break your system. So make sure you know what you are doing! 

If the installed version is too old for your needs or you just want to remove it, here's a single command to do so:

sudo apt remove imagemagick* -y

That's it!

2. Install the latest version of ImageMagick on Ubuntu (complicated)

To build ImageMagick from source, first, you'd have to install some prerequisites using the following command:

sudo apt install git build-essential make

Once done, clone the git repository using the following:

git clone https://github.com/ImageMagick/ImageMagick.git

Next, change your directory to ImageMagick:

cd ImageMagick

Now, execute the configure script to check the dependencies:

./configure

Then, use the make command to build packages:

make

And finally, install the packages using the following:

sudo make install

Once done, use the following command to configure the dynamic linking:

sudo ldconfig /usr/local/lib

That's it! You have the latest version of ImageMagick installed on your system.

While writing, it gave me ImageMagick version 7.1.1-12:

install the latest version of ImageMagick in Ubuntu

How to uninstall:

If you want to remove the ImageMagick installed from the source, here are simple steps you need to follow.

First, change your directory to ImageMagick:

cd ~/ImageMagick

And use the following command to remove it:

sudo make uninstall

That's it!

Just getting started? Here are the essentials

If you are just getting started with the Ubuntu command line, we have a dedicated guide on must-to-know commands in Ubuntu:

25 Must-Know Ubuntu Commands
New to Ubuntu? Here are the must know Ubuntu commands that will help you get control on the system more effectively in the terminal.

I hope you will find this guide helpful.



Sagar Sharma

Sagar Sharma

A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.