How To Install open-cobol on Ubuntu 18.04

In this tutorial we learn how to install open-cobol on Ubuntu 18.04. open-cobol is COBOL compiler

Introduction

In this tutorial we learn how to install open-cobol on Ubuntu 18.04.

What is open-cobol

open-cobol is:

OpenCOBOL implements substantial part of the COBOL 85 and COBOL 2002 standards, as well as many extensions of the existent compilers. OpenCOBOL translates COBOL into C and compiles the translated code using GCC.

There are three methods to install open-cobol 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 open-cobol Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install open-cobol

Install open-cobol Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install open-cobol

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

sudo aptitude -y install open-cobol

How To Uninstall open-cobol on Ubuntu 18.04

To uninstall only the open-cobol package we can use the following command:

sudo apt-get remove open-cobol

Uninstall open-cobol And Its Dependencies

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

sudo apt-get -y autoremove open-cobol

Remove open-cobol Configurations and Data

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

sudo apt-get -y purge open-cobol

Remove open-cobol configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge open-cobol

References

Summary

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