Tesseractis is an open-source cross-platform OCR software for Linux, macOS, and Windows operating systems.
We cannot realize the significance of an OCR software unless we encounter a condition in which we have to extract the text from an image.
In this context, we shall look into the different ways of installing Tesseract on a Linux Mint 20 system.
1. Tesseract installation via the Snap Package Manager
Here, you need to have the Snap Package Manager installed on your Linux Mint 20 system. On Linux Mint 20, /etc/apt/preferences.d/nosnap.pref needs to be removed before Snap can be installed. This can be accomplished from the command line:
$ sudo rm /etc/apt/preferences.d/nosnap.pref
$ sudo apt update
To install snap from the Software Manager application, search for snapd and click Install.
Alternatively, snapd can be installed from the command line:
$ sudo apt install snapd
After snap installation, proceed with the below steps:
i. Install Tesseract on Linux Mint 20
You can install Tesseract by running the following terminal command:
$ sudo snap install tesseract --edge
ii. Confirm Tesseract Installation
After the successful installation of Tesseract on your system, you might want to know its version which can be checked by running the following command:
$ tesseract --version
The version of Tesseract installed on your system will be displayed as a result of running the above-mentioned command.
2. Tesseract installation via the APT Package Manager
Here, you do not need to have any prior installations rather you can simply proceed with the following command for installing Tesseract on your Linux Mint 20 system:
$ sudo apt install tesseract-ocr –y
This command will immediately install Tesseract on your Linux Mint 20 system.
1. If you have installed Tesseract using the Snap Package Manager, then you can remove it by running the command shown below:
$ sudo snap remove tesseract
2. If you have installed Tesseract on your system by using the APT Package Manager, then you will have to run the command shown below to remove it from your system:
$ sudo apt-get purge --autoremove tesseract-ocr –y
This article covers the installation procedure of Tesseract OCR on a Linux Mint 20 system. In fact, Tesseract is an optical text recognition (OCR) engine developed by Google used for recognizing a text in image.
How to Install Tesseract OCR on Ubuntu ?
1. Add the Tesseract OCR repository:
$ sudo add-apt-repository -y ppa:alex-p/tesseract-ocr-devel
2. Install Tesseract OCR 5:
$ sudo apt install -y tesseract-ocr
3. When installation is finished, we can check Tesseract OCR version:
$ tesseract --version
How to Uninstall Tesseract OCR from Ubuntu Linux system ?
If you decided to completely remove Tesseract OCR and related dependencies, run the following command:
$ sudo apt purge --autoremove -y tesseract-ocr
2. Remove GPG key and repository:
$ sudo rm -rf /etc/apt/trusted.gpg.d/alex-p_ubuntu_tesseract-ocr-devel.gpg
$ sudo rm -rf /etc/apt/sources.list.d/alex-p-ubuntu-tesseract-ocr-devel-focal.list