How To Install libgd-graph-perl on Ubuntu 18.04

In this tutorial we learn how to install libgd-graph-perl on Ubuntu 18.04. libgd-graph-perl is Graph Plotting Module for Perl 5

Introduction

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

What is libgd-graph-perl

libgd-graph-perl is:

GD::Graph is a perl5 module to create charts using the GD module. The following classes for graphs with axes are defined:

  • GD::Graph::lines - Create a line chart.
  • GD::Graph::bars - Create a bar chart.
  • GD::Graph::points - Create an chart, displaying the data as points.
  • GD::Graph::linespoints - Combination of lines and points.
  • GD::Graph::area - Create a graph, representing the data as areas under a line.
  • GD::Graph::mixed - Create a mixed type graph, any combination of the above. At the moment this is fairly limited. Some of the options that can be used with some of the individual graph types won’t work very well. Multiple bar graphs in a mixed graph won’t display very nicely.
  • GD::Graph::pie - Create a pie chart.

There are three methods to install libgd-graph-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-graph-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-graph-perl using apt-get by running the following command:

sudo apt-get -y install libgd-graph-perl

Install libgd-graph-perl Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install libgd-graph-perl

Install libgd-graph-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-graph-perl using aptitude by running the following command:

sudo aptitude -y install libgd-graph-perl

How To Uninstall libgd-graph-perl on Ubuntu 18.04

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

sudo apt-get remove libgd-graph-perl

Uninstall libgd-graph-perl And Its Dependencies

To uninstall libgd-graph-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-graph-perl

Remove libgd-graph-perl Configurations and Data

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

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

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

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

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

References

Summary

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