How To Install gd on CentOS 7

In this tutorial we learn how to install gd on CentOS 7. gd is A graphics library for quick creation of PNG or JPEG images

Introduction

In this tutorial we learn how to install gd on CentOS 7.

What is gd

The gd graphics library allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and to write out the result as a PNG or JPEG file. This is particularly useful in Web applications, where PNG and JPEG are two of the formats accepted for inline images by most browsers. Note that gd is not a paint program. The gd graphics library allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and to write out the result as a PNG or JPEG file. This is particularly useful in Web applications, where PNG and JPEG are two of the formats accepted for inline images by most browsers. Note that gd is not a paint program.

We can use yum or dnf to install gd on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install gd.

Install gd on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install gd using yum by running the following command:

sudo yum -y install gd

Install gd on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install gd using dnf by running the following command:

sudo dnf -y install gd

How To Uninstall gd on CentOS 7

To uninstall only the gd package we can use the following command:

sudo dnf remove gd

References

Summary

In this tutorial we learn how to install gd on CentOS 7 using yum and dnf.