PDFTK is a very handy package that handles PDFs. It could open and write to existing PDFs, and a lot of other great things. However, it is missing from the Ubuntu 18 and is very tricky to install on Ubuntu 18 (but works nice and smoothly on Ubuntu 16). This tutorial is intended to save you some time/hair when you have to install PDFTK on ubuntu 18.
sudo apt-get update
to update the current libssudo apt-get install libcairo2 libpango-1.0-0 libpangocairo-1.0.0 libgdk-pixbuf2.0-0 libffi-dev libmagickwand-dev
to install all the necessary packageslocate sources.list
to find the path for the sources.list filesudo nano /etc/apt/sources.list
to go into the file and edit itdeb http://no.archive.ubuntu.com/ubuntu/ artful main restricted
deb http://no.archive.ubuntu.com/ubuntu/ artful-updates main restricted
deb http://no.archive.ubuntu.com/ubuntu/ artful universe
deb http://no.archive.ubuntu.com/ubuntu/ artful-updates universe
deb http://no.archive.ubuntu.com/ubuntu/ artful multiverse
deb http://no.archive.ubuntu.com/ubuntu/ artful-updates multiverse
deb http://no.archive.ubuntu.com/ubuntu/ artful-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu artful-security main restricted
deb http://security.ubuntu.com/ubuntu artful-security universe
deb http://security.ubuntu.com/ubuntu artful-security multiverse
CTRL + x
(and hit enter) to save and quitsudo apt update
sudo apt-get install libgcj-common
sudo apt-get install libgcj17
sudo apt-get install pdftk