Install ImageMagick on Ubuntu

Learn how to install ImageMagick on Ubuntu easily from its repositories. Also learn about getting the latest version from the source code if you want that.
Warp Terminal

ImageMagick is a popular open-source software that allows you to manipulate digital images in almost every way and supports more than 200 image formats!!

The chances that ImageMagick has already been installed on your Ubuntu system are pretty high as many other software use it as a dependency. Verify it with:

convert -version
📋
Yes. ImageMagick is a CLI tool and it is used as convert, not imagemagick in the terminal. That’s where a lot of users make mistakes.

If you see the “convert command not found” error, you can install ImageMagick using this command in Ubuntu:

sudo apt install imagemagick

But it may not give you the latest version. Let’s see how to get ImageMagick in detail and how to install the latest version from the source code.

Installing ImageMagick on Ubuntu

If getting the most recent version is not your primary concern, you can use the default repository of Ubuntu to install a bit older but comparatively more stable version than the most recent one.

Method 1: Install from software center (GUI method)

Open Ubuntu Software center.

open ubuntu software from system menu

Now, search for ImageMagick in the store by clicking on the little search icon located in the top left corner.

search for imagemagick in ubuntu software

For all the given results, open the first one and click on the Install button. Yep, that’s it!

click on install button to install imagemagick in ubuntu

Method 2: Install ImageMagic from the terminal

In my opinion, this is the most convenient way to install ImageMagick in Ubuntu. A single command is all you’d need to complete the installation.

sudo apt install imagemagick
sudo apt install imagemagick

Checking the installed version of ImageMagick is a bit different compared to other utilities.

convert -version

It should bring something similar to this:

Check installed version of ImageMagick

Removing ImageMagick

I strongly advise against removing ImageMagick. It is often installed automatically as a dependency for other software packages. Unless you have a solid reason, don’t uninstall it. You have been fairly advised.

To remove ImageMagick, use this command.

sudo apt remove imagemagick* -y
sudo apt remove imagemagick y

Install latest version of ImageMagick from the source code (for advanced and desperate users)

🚧
It is not advised for regular users. Unless you desperately need the new version of a solid reason, don’t go for this method. You have been warned.

This process requires users to compile ImageMagick from the source to get the most recent version. So obviously, it will require comparatively more effort than the above method.

First, you’d need some dependencies to download and compile ImageMagick, which you can download by the given command:

sudo apt install build-essential make git

Once you’re done with dependencies, you can proceed to the further part that involves downloading ImageMagick from Git.

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

And change your working directory to ImageMagick:

cd ImageMagick
cloning to imagemagick

Our first step toward any compilation should be the configuration of the source code. It may seem complex, but it’s just a one-word command:

./configure
configuring source code of imagemagick

Now, it’s time to use make the command to build what we’ve configured previously. If all of this seems out of the world, we have a detailed guide on how to install and uninstall packages from source code.

make
make command in compilation of software from source code

Now, let’s install those compiled files by the given command:

sudo make install

After the installation process, let’s configure the run-time dynamic linking of ImageMagick:

sudo ldconfig /usr/local/lib
sudo ldconfig

So which version of ImageMagick, you’d get after going through this long process? Well, let me show you the installed version of ImageMagick after going through this process.

convert -version
checking version of imagemagick after building from source

While writing, it gave me ImageMagick version 7.1.0-48, which is much ahead of what you get when you use the default repository (6.9.11-60).

Uninstallation of ImageMagick from source code

Compared to installation, the removal process is quite straightforward. Just a few steps and ImageMagick will be removed from the system in no time.

First, change your working directory to ImageMagick:

cd ImageMagick

And then use the given command for uninstallation:

sudo make uninstall
sudo make uninstall

Checking the version is always a good idea to check whether you have successfully removed the software from your system or not:

convert -version
imagemagick not found

That’s it.

Final Words

This was my take on how to install ImageMagick by utilizing the default repository and compiling it from the source to get the most recent version.

If you still have any doubts, let me know in the comments.

About the author
Sagar Sharma

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

It's FOSS

Making You a Better Linux User

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.