How To Install gocr on Debian 11

In this tutorial we learn how to install gocr on Debian 11. gocr is Command line OCR

Introduction

In this tutorial we learn how to install gocr on Debian 11.

What is gocr

gocr is:

This is a multi-platform OCR (Optical Character Recognition) program.

It can read pnm, pbm, pgm, ppm, some pcx and tga image files.

Currently the program should be able to handle well scans that have their text in one column and do not have tables. Font sizes of 20 to 60 pixels are supported.

If you want to write your own OCR, libgocr is provided in a separate package. Documentation and graphical wrapper are provided in separated packages, too.

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

Install gocr Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install gocr

Install gocr Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install gocr

Install gocr 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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install gocr

How To Uninstall gocr on Debian 11

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

sudo apt-get remove gocr

Uninstall gocr And Its Dependencies

To uninstall gocr and its dependencies that are no longer needed by Debian 11, we can use the command below:

sudo apt-get -y autoremove gocr

Remove gocr Configurations and Data

To remove gocr configuration and data from Debian 11 we can use the following command:

sudo apt-get -y purge gocr

Remove gocr configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge gocr

Dependencies

gocr have the following dependencies:

References

Summary

In this tutorial we learn how to install gocr package on Debian 11 using different package management tools: apt, apt-get and aptitude.