The convenient pdf manipulation tool
pdftk is not available in Ubuntu 18.04 repositories because of some licensing incompatibilities. Using some docker magic and a small script we’ll use it as in previous Ubuntu releases, since it’s still available in 16.04 repositories. Here we will exploit the docker capabilities to run the
pdftk binaries in the container.
Prerequisites: docker should be installed and working. Easiest thing to do is
sudo apt-get update && sudo apt-get install docker-ce && sudo usermod -aG docker $USER
and reinitiate the user session for the changes to take effect (logoff completely and relogin) or you’ll be able to run docker as root user only.
A convenience installation one-liner (second version of the script):
sudo wget https://gist.githubusercontent.com/sheershoff/a1e068b3f6ed60ed87f56a9e5dce312b/raw/ea9bc8462c0b8aab6e30efa7bffc9e02d0e58cfe/pdftk -O /usr/local/bin/pdftk && sudo chmod a+x /usr/local/bin/pdftk
Or for manual installation put this script somewhere on your
chmod a+x SCRIPT_PATH. Then use
pdftk normally as you did before.
Comments, corrections are welcome )