How To Install libgd-perl on Ubuntu 18.04

In this tutorial we learn how to install libgd-perl on Ubuntu 18.04. libgd-perl is Perl module wrapper for libgd

Introduction

In this tutorial we learn how to install libgd-perl on Ubuntu 18.04.

What is libgd-perl

libgd-perl is:

This is a autoloadable interface module for libgd, a popular library for creating and manipulating PNG files. With this library you can create PNG images on the fly or modify existing files. Features include:

  • Lines, polygons, rectangles and arcs, both filled and unfilled
  • Flood fills
  • The use of arbitrary images as brushes and as tiled fill patterns
  • Line styling (dashed lines and the like)
  • Horizontal and vertical text rendering
  • Support for transparency and interlacing
  • Support for TrueType font rendering, via libfreetype.
  • Support for spline curves, via GD::Polyline
  • Support for symbolic font names, such as “helvetica:italic”
  • Support for symbolic color names, such as “green”, via GD::Simple
  • Produces output in png, gif, jpeg and xbm format
  • Produces output in svg format via GD::SVG.

Included with the example code is the perl script qd.pl with QuickDraw routines for generating PICT2 files (used on Apple Macintosh).

There are three methods to install libgd-perl on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libgd-perl Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libgd-perl using apt-get by running the following command:

sudo apt-get -y install libgd-perl

Install libgd-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libgd-perl using apt by running the following command:

sudo apt -y install libgd-perl

Install libgd-perl Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libgd-perl using aptitude by running the following command:

sudo aptitude -y install libgd-perl

How To Uninstall libgd-perl on Ubuntu 18.04

To uninstall only the libgd-perl package we can use the following command:

sudo apt-get remove libgd-perl

Uninstall libgd-perl And Its Dependencies

To uninstall libgd-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libgd-perl

Remove libgd-perl Configurations and Data

To remove libgd-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libgd-perl

Remove libgd-perl configuration, data, and all of its dependencies

We can use the following command to remove libgd-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libgd-perl

References

Summary

In this tutorial we learn how to install libgd-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.