12

Currently (25.09.2017)

$ sudo apt-get install wkhtmltopdf

installs wkhtmltopdf 0.12.2.4, but the website shows that we have version 0.12.4 already.

How can I install the latest version of wkhtmltopdf on Ubuntu 16.04?

Martin Thoma
  • 18,749
  • 26
  • 70
  • 97

3 Answers3

18

Steps to install wkhtmltopdf 0.12.3 on Ubuntu 16.04.

Log in as root, then:

cd ~
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz 
cp wkhtmltox/bin/wk* /usr/local/bin/

And you can confirm with:

$ wkhtmltopdf --version
wkhtmltopdf 0.12.3 (with patched qt)

By the way, I chose 0.12.3 instead of 0.12.4 because of a strange page sizing issue, discussed on the wkhtmltopdf GitHub.

grooveplex
  • 2,486
  • 3
  • 25
  • 35
Joshua Pinter
  • 527
  • 3
  • 11
  • Did you need to make your extracted file(s) executable? – user535733 Nov 15 '17 at 00:58
  • @user535733 I didn't have to but I was logged in to the server as `root`. – Joshua Pinter Nov 15 '17 at 03:40
  • That's rather important for people trying your solution to know. Do you have a non-root solution? Suggesting unskilled users jump to a root prompt for such a trivial action seems unwise. – user535733 Nov 15 '17 at 13:49
  • 1
    @user535733 I'm definitely not suggesting jumping to a root prompt, but they can always use `sudo` if it's a system-wide installation requirement. Feel free to make any edits to the answer. – Joshua Pinter Nov 21 '17 at 14:14
  • No intent to criticize the solution, apologies if it seemed so. Merely suggested a minor addition, to prevent "Hey, this didn't work for me" complaints. – user535733 Nov 21 '17 at 14:54
  • @user535733 No worries. :) Hopefully this comment thread can now act as documentation for people that might need to use `sudo`. – Joshua Pinter Nov 21 '17 at 16:35
  • Had to install `libssl1.0-dev` on Lubuntu 16.04 – Gus Mar 11 '19 at 18:25
5
$ sudo apt-get install wget
$ mkdir wkhtmltopdf-download
$ cd wkhtmltopdf-download
wkhtmltopdf-download $ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
wkhtmltopdf-download $ tar xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
wkhtmltopdf-download $ cd wkhtmltox/bin

Then just move the binaries somewhere in your PATH. See

$ echo $PATH

For me, it was mv * /home/math/bin. And finally:

$ wkhtmltopdf --version
wkhtmltopdf 0.12.4 (with patched qt)
Martin Thoma
  • 18,749
  • 26
  • 70
  • 97
0

As of this moment, when you try to install wkhtmltopdf from the Ubuntu's repositories, it will install the version 0.12.4.

efthialex
  • 3,781
  • 1
  • 23
  • 31
mehmet
  • 101
  • 1