How To Install ghostscript on Ubuntu 20.04

In this tutorial we learn how to install ghostscript on Ubuntu 20.04. ghostscript is interpreter for the PostScript language and for PDF interpreter for the PostScript language and for PDF

Introduction

In this tutorial we learn how to install ghostscript on Ubuntu 20.04.

What is ghostscript

ghostscript is:

GPL Ghostscript is used for PostScript/PDF preview and printing. Usually as a back-end to a program such as ghostview, it can display PostScript and PDF documents in an X11 environment.

Furthermore, it can render PostScript and PDF files as graphics to be printed on non-PostScript printers. Supported printers include common dot-matrix, inkjet and laser models. Task: print-server, ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop

Package: ghostscript Architecture: amd64 Version: 9.50~dfsg-5ubuntu4 Multi-Arch: foreign Priority: optional Section: text Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian Printing Team [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 226 Provides: postscript-viewer Depends: libgs9 (= 9.50~dfsg-5ubuntu4), libc6 (>= 2.4) Suggests: ghostscript-x Filename: pool/main/g/ghostscript/ghostscript_9.50~dfsg-5ubuntu4_amd64.deb Size: 51416 MD5sum: d9694f2eced534da171c27fef6bfeb65 SHA1: 98eff07b084a690f76f3bdb66f9f5e68a48a14a6 SHA256: 3dea6dd42ff9f160636c4b428c75413ac8238c63e616dbde61751c870bb534d4 Homepage: https://www.ghostscript.com/ Description-en: interpreter for the PostScript language and for PDF GPL Ghostscript is used for PostScript/PDF preview and printing. Usually as a back-end to a program such as ghostview, it can display PostScript and PDF documents in an X11 environment.

Furthermore, it can render PostScript and PDF files as graphics to be printed on non-PostScript printers. Supported printers include common dot-matrix, inkjet and laser models. Task: print-server, ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop

There are three methods to install ghostscript on Ubuntu 20.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 ghostscript Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install ghostscript

Install ghostscript Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install ghostscript using apt by running the following command:

sudo apt -y install ghostscript

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

sudo aptitude -y install ghostscript

How To Uninstall ghostscript on Ubuntu 20.04

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

sudo apt-get remove ghostscript

Uninstall ghostscript And Its Dependencies

To uninstall ghostscript and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove ghostscript

Remove ghostscript Configurations and Data

To remove ghostscript configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge ghostscript

Remove ghostscript configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge ghostscript

References

Summary

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