Tested on Ubuntu 20.04 but should be very similar for all Ubuntu/Debian systems. Logged in as root because I'm feeling lucky.
# Base installation
apt update && apt upgrade -y \
&& apt install -y joe git build-essential jq screen| sudo yum install -y autoconf aclocal automake | |
| sudo yum install -y libtool | |
| sudo yum install -y libjpeg-devel libpng-devel libtiff-devel zlib-devel | |
| cd ~/downloads | |
| wget http://www.leptonica.com/source/leptonica-1.72.tar.gz | |
| tar -zxvf leptonica-1.72.tar.gz | |
| cd leptonica-1.72 | |
| ./configure | |
| make | |
| sudo make install |