Ubuntu

How to Install the Latest ImageMagick on Ubuntu 22.04

ImageMagick is a free, open-source, and cross-platform application to manage digital images. ImageMagick can manage the files of over 200 formats that include JPEG, PNG, SVG, PDF, HEIC, and many more.

ImageMagick is used to perform various operations such as resizing, cropping, rotating, drawing lines, curves, and so on. This article presents a brief installation guide of ImageMagick on Ubuntu 22.04 with the following learning outcomes:

  • How to install ImageMagick on Ubuntu 22.04 using the apt command
  • How to install ImageMagick on Ubuntu 22.04 using the source file

How to install ImageMagick on Ubuntu 22.04

ImageMagick is available on the official repository of Ubuntu 22.04 and the source file of the ImageMagick can also be used to install it on Ubuntu 22.04. This concludes that ImageMagick can be installed on Ubuntu 22.04 via two methods i.e., using apt and using the source file. This section presents the

How to install ImageMagick on Ubuntu 22.04 using the apt command

The apt command helps to get packages from the official repository of Ubuntu (or any Debian-based distribution) and install/remove them on your system. The following steps are recommended to get ImageMagick on Ubuntu 22.04.

Step 1: Open the terminal (CTRL+ALT+T) and update the core libraries of Ubuntu via the following command:

$ sudo apt update

Step 2: After the system packages list is updated, you can install ImageMagick by issuing the following command:

$ sudo apt install imagemagick

Step 3: You need to verify the installation. To do so, the identify program is used as it belongs to the toolset of ImageMagick. The following command will print the installed version of the ImageMagick on Ubuntu 22.4:

$ identify --version

The output shows that ImageMagick 6.9.11-60 is the version installed from the official repository of Ubuntu 22.04.

How to install ImageMagick on Ubuntu using the source file

The source file of the ImageMagick can be obtained from the official website of ImageMagick. This section enlists the steps required to install ImageMagick on Ubuntu from the source file.

Step 0: This step refers to preparing your Ubuntu 22.04 to get ready for installing ImageMagick from the source code. The below-mentioned command will install the essentials that are necessary for installing Magick from source code:

$ sudo apt install build-essential make

Step 1: Execute the following command to download the source file of ImageMagick:

$ wget https://download.imagemagick.org/ImageMagick/download/ImageMagick.tar.gz

Step 2: Now, extract the tar.gz file by issuing the following command in the terminal:

$ tar xzvf ImageMagick.tar.gz

You are required to get your terminal into the extracted directory to compile/install ImageMagick.

$ cd ImageMagick-7.1.0-31

Step 3: Once you are in the directory, execute the configure script via the following command. The configure script checks the availability of the dependencies and the install process. These dependencies are required to build the software on your system.

$ ./configure

You are ready to now build your software by issuing the following command. The make command executes the operations defined inside the “Makefile“:

$ make

Step 4: The commands in the above step (Step 3) will prepare the package for installation. Now, use the following command to install ImageMagick on your system properly:

$ sudo make install

After that, configure the dynamic linker run-time bindings by issuing the below-mentioned command:

$ sudo ldconfig /usr/local/lib

Check the installed version with the help of the following command:

$ magick --version

How to remove ImageMagick from Ubuntu 22.04

The ImageMagick and all its dependencies can be removed from Ubuntu 22.04 via the following command:

$ sudo apt autoremove imagemagick

Conclusion

ImageMagick is an open-source application to perform several operations on bitmap images. ImageMagick support is available for Windows, Linux, and macOS. This article demonstrates the installation of the ImageMagick on Ubuntu 22.04 via the apt command and the source file. The apt command gets the package from the official repository of Ubuntu where the source file can be obtained from the website of the ImageMagick.

About the author

Adnan Shabbir