Installing Tesseract on Amazon Linux 2
I got stuck with the problem of installing tesseract on amazon linux 2 with yum and I have found myself always perturbed by the rpm based distros. Had it been debian, things would be a bit easier for me.
Anyhows, I’m sharing this for future reference of myself and of anyone who would find them in the same pickle.
Install Command
yum install -y tesseract
However, yum returns with the error that no modules found. In which case, we would need to install epel-release-latest-7 before install tesseract.
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y update
More Errors
It might happen that the yum is still missing some of the libraries such as libpng, libjpeg, etc. For that, the followings commands would take care of it.
yum install -y git libtool clang gcc-c++.x86_64
yum install -y zlib zlib-devel libjpeg libjpeg-devel libwebp libwebp-devel libtiff libtiff-devel libpng libpng-devel
cp /usr/lib64/libjpeg.so.62 /usr/local/lib/
cp /usr/lib64/libwebp.so.4 /usr/local/lib/
cp /usr/lib64/libtiff.so.5 /usr/local/lib/
cp /usr/lib64/libpng15.so.15 /usr/local/lib/
There may be additional libraries being install above, but that combination got me going with some other stuff that I had needed. I didn’t spend time pruning it to the bare minimum and the readers are invited to share that in comments.
Happy Coding!