52

I tried to install pdftk in Ubuntu 18.04. It seems to be that the package is missing from official repositories.

How can I install pdftk?

fosslinux
  • 3,831
Ivan
  • 889

2 Answers2

25

pdftk is missing from the official repository right now. That's an issue for many people.

There's a workaround here: How can I install pdftk in Ubuntu 18.04 Bionic?

However some might prefer a GTK approach and/or use a standard installation instead of one relying on OpenJDK. Those more acquainted with the terminal can download and install from there.

You'll need:

Basically the process is opening and installing the .deb files - preferably on gdebi - in the order below. It might be interesting to open pdftk first on gdebi just to see the "impossible dependency" warning. We're basically installing the dependencies from an older repository, so it'll run like it did in 17.10. The order is:

  • libgcj-common
  • libgcj17
  • pdftk

After that you might want to check the status of pdftk at the software center - it might say it is not installed; install there or maybe just let it be.

Go to the terminal and check pdftk:

$ pdftk

It should now be installed.

Ivan
  • 889
  • 2
    See bugs.launchpad.net/ubuntu/+source/pdftk/+bug/1764450 and mark the bug as affecting you as well. – DK Bose Apr 29 '18 at 04:31
  • Also: https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-bionic-shell-version-no-gtk – DK Bose Apr 29 '18 at 04:32
  • I'm on Kubuntu 18.04 and tried installing these packages via QApt. The first two work fine, but for pdftk, I get: Error: cannot satisfy dependencies. Any thoughts? – Philip Leifeld Apr 29 '18 at 13:25
  • Hi Philip. Does it say what specific dependency is missing? I have no experience with Kubuntu (just with Manjaro KDE), maybe the GCC set is different.

    You could try libgcj17 (https://packages.ubuntu.com/artful/libgcj17) or maybe checking each of the dependencies.

    See if one of the dependencies of pdftk is not there (https://packages.ubuntu.com/artful/pdftk)

    It is possible that the problem is due to a dependency of a dependency missing from bionic's repos -- that was the case with libgcj16 that required the unlisted libgcj-common.

    – Ivan Apr 30 '18 at 05:46
  • Link to bug report commented by @DKBose. Its also affecting the latest version of Fedora, Fedora 28, see this report. Its for the best I think, we should all focus on contributing to QPDF. – olfek May 21 '18 at 20:02
  • I'm getting this error: $ gdebi pdftk_2.02-4build1_amd64.deb outputs: Dependency is not satisfiable: libgcj17 (>= 5) – khatchad May 29 '18 at 21:51
  • 16
    In my case: sudo snap install pdftk – Daniel Aug 07 '18 at 17:15
  • @Ivan can explain why you said: GDebi (highly recommended over GNOME Software/Software Center)? – mike stewart Aug 31 '18 at 18:18
  • 1
    hello @mikestewart, unfortunately, for reasons I don't know, the GNOME software center has issues with configuring dependencies, unpacking, and setting them up in the system.

    maybe it has been fixed already, but I remember from earlier LTS releases of things like not being able to run .deb packages and (in this version and earlier version) the program installs but there are missing dependencies that the software center didn't warn you about, despite saying the install was succesful - it has been a while, but, if I remember correctly, believe this was one of the issues with pdftk

    – Ivan Sep 02 '18 at 02:11
  • @mikestewart GDebi is more transparent and makes it easier to troubleshoot, install & remove... might not be needed after a while, but in my experience you'll always end up needing it in the early days of a release. An example: https://askubuntu.com/questions/760638/problem-with-deb-packages-on-ubuntu-16-04 – Ivan Sep 02 '18 at 02:17
  • The workaround linked at the top worked for me: 1) Manually download pdftk-java deb file from a newer Ubuntu release, 2) install the .deb file using gdebi 3) rock on! (executable was named pdftk.pdftk-java in my case) – arr_sea May 08 '19 at 21:32
  • All the 'artful' pages linked to above only contain the error message 'Error: two or more packages specified (pdftk artful)' at this point in time. :( – zrajm Sep 19 '20 at 04:31
11

Not exactly the same thing, but for some operations I've found useful QPDF to manipulate PDFs in Ubuntu 18.04 LTS Bionic Beaver.

At time of this writing (May 2018) the project seems to be active and well mantained.

bytepan
  • 501
  • For anyone who came here looking to append multiple pdfs into one (my #1 use case for pdftk), beware that the documented way to do this in qpdf does not work in 8.0.2-3, the latest Bionic release: https://github.com/qpdf/qpdf/issues/129 – Adam Bliss Mar 02 '20 at 14:16