- Newest
- Most votes
- Most comments
Installing tesseract-ocr on Amazon Linux 2023 can be challenging since it's not available in the default DNF/YUM repositories, and EPEL is not supported. However, there are a few alternative approaches you can try:
-
Compile from source: This is a more involved process, but it ensures you get the latest version. You'll need to install the necessary dependencies first, then download and compile Tesseract from its source code.
-
Use an alternative repository: While EPEL isn't available, you can try adding the Fedora 36 repository to your system. This may allow you to install tesseract-ocr. Here's how you can do it:
a. Create a new repository file: sudo vi /etc/yum.repos.d/fedora.repo
b. Add the following content to the file: [fedora] name=Fedora 36 - $basearch metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-36&arch=$basearch enabled=0 countme=1 metadata_expire=7d repo_gpgcheck=0 type=rpm gpgcheck=1 gpgkey=https://getfedora.org/static/fedora.gpg skip_if_unavailable=False
c. Save and close the file.
d. Install tesseract-ocr using the following command: sudo dnf --enablerepo=fedora install tesseract -y
-
Use a container: If your use case allows, you could run Tesseract in a container based on a different Linux distribution that includes the package.
-
Manual installation: As a last resort, you could try downloading the RPM packages for tesseract-ocr and its dependencies from a compatible repository (like Fedora or CentOS) and installing them manually. However, this method may lead to compatibility issues and is not recommended for production environments.
Remember that whichever method you choose, you'll need to ensure that the Tesseract version is compatible with your specific requirements and other software dependencies in your system. Also, be prepared to manage any potential conflicts or dependencies manually.
If Tesseract is critical for your application, you might want to consider if Amazon Linux 2023 is the best choice for your needs, or if another distribution that includes these packages might be more suitable.
Sources
PHP Repository Installation | AWS re:Post
Amazon Linux 2023 without librdkafka and librdkafka-devel RPM | AWS re:Post
Relevant content
- asked 2 years ago

We (Amazon Linux) do not recommend using RPMs built for other Linux distributions, as at any point in time an update to either those packages, or to Amazon Linux, may make them no longer work. We have had a request to add tesseract-ocr to Amazon Linux, which can be tracked on our GitHub Issues page: https://github.com/amazonlinux/amazon-linux-2023/issues/959