gm command not found

In this troubleshooting guide we learn how to fix gm command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

gm: command not found

or when using sudo you get the following error message

sudo: gm: command not found

Solutions to gm: command not found

How To Fix gm: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu gm is provided by graphicsmagick package.

graphicsmagick is:

GraphicsMagick provides a set of command-line applications to manipulate image files. It is a fork of the ImageMagick project and therefore offers a similar set of features, but puts a larger emphasis on stability.

The tools support a large variety of image formats from the widely used jpeg, tiff, bmp or xpm to special-purpose formats such as fits or image formats found on some photo CDs. They can convert between formats, concatenate several images into one, annotate and distort them, create thumbnails or manipulate the colormap. While all features are available from the command-line, the package also includes an image viewer that allows interactive manipulation.

Note that unlike ImageMagick, the GraphicsMagick tools are accessed through a single executable called ‘gm’. Therefore, GraphicsMagick and ImageMagick can be used in parallel. Install package graphicsmagick-imagemagick-compat to obtain a set of several executables that is compatible to ImageMagick’s interface.

To fix this problem, we can install more using the command below.

sudo apt-get -y install graphicsmagick

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install graphicsmagick.

sudo apt -y install graphicsmagick

Or if you have aptitude installed you can use the following command.

sudo aptitude install graphicsmagick

Summary

In this tutorial we learn how to fix gm command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.