This might work on Ubuntu 18, as well, but I have not tested it. Also, there is no official build release for it. You might need to compile it on your own.
Note: if you are getting the “GLIBC_2.7′ not found” error, it could be that you need to uninstall and then reinstall a specific version of WKHTMLTOPDF.
You might also find a lot of install routines that just say “works on Ubuntu” or “works on CentOS”, etc. Make sure to check the version that matches your OS and OS version!
First, take a look at the downloads for WKHTMLTOPDF. There are releases for each version that have been built on that version. You can also look at their builds list here: https://builds.wkhtmltopdf.org/
I installed the Xenial amd64 release. Here’s my installation routine:
Right click on the release you want and copy the URL. Then paste that for the wget command.
sudo wget https://builds.wkhtmltopdf.org/0.12.1.4/wkhtmltox_0.12.1.4-1.xenial_amd64.deb
sudo dpkg -i wkhtmltox_0.12.1.4-1.xenial_amd64.deb
sudo apt-get install -f
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin
Then run to get the version and check the installation
sudo wkhtmltopdf -V
wkhtmltopdf 0.12.1.4 (with patched qt)