gd2topng command not found

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

Introduction

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

gd2topng: command not found

or when using sudo you get the following error message

sudo: gd2topng: command not found

Solutions to gd2topng: command not found

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

In Ubuntu gd2topng is provided by libgd-tools package.

libgd-tools is:

GD is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colours, cut and paste from other images, flood fills, and write out the result as a PNG file. This is particularly useful in World Wide Web applications, where PNG is one of the formats accepted for inline images by most browsers.

This is some simple command line tools and example code that use the GD graphics library.

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

sudo apt-get -y install libgd-tools

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

You can also use apt command to install libgd-tools.

sudo apt -y install libgd-tools

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

sudo aptitude install libgd-tools

Summary

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