I am trying to install current stable version 0.12.1
, but it only installs 0.9.9
.
Any chance to install latest version with apt-get install
? It seems that 0.9.9
is very old :(
-
See also: How can I install the latest wkhtmltopdf on Ubuntu 16.04?– Martin ThomaSep 25, 2017 at 7:56
6 Answers
In Ubuntu 16.04 and later wkhtmltopdf 0.12.2+ can be installed from the default Ubuntu repositories.
In Ubuntu 14.04, open the terminal and type:
sudo add-apt-repository ppa:ecometrica/servers
sudo apt-get update
sudo apt-get install wkhtmltopdf
In Ubuntu 12.04, open the terminal and type:
sudo add-apt-repository ppa:pov/wkhtmltopdf
sudo apt-get update
sudo apt-get install wkhtmltopdf
and one step after this is to reboot the server or else you will get the error: wkhtmltopdf: cannot connect to X server
.
-
Just tried the 12.04 instructions, wasn't able to successfully download from the PPA: Failed to fetch ppa.launchpad.net/pov/wkhtmltopdf/ubuntu/dists/trusty/main/… 404 Not Found– NeilNov 4, 2015 at 21:22
-
The links at ppa:pov/wkhtmltopdf are live. I was able to download the .deb file of wkhtmltopdf for Ubuntu 12.04 from it manually from: launchpad.net/~pov/+archive/ubuntu/wkhtmltopdf/+sourcepub/…– karelNov 4, 2015 at 22:11
-
(Using v0.12.0-2 from ppa:ecometrica/servers on Ubuntu Server 14.04) I still get "Cannot connect to X server" unless I use xvfb as described in askubuntu.com/a/605644/7146 Dec 21, 2015 at 13:20
-
1is ecometrica/servers still maintained? I was not able to find an up to date ppa for 0.12.2 (Jan 15) anywhere on launchpad– SteveDec 23, 2015 at 3:04
-
@Steve The latest version of wkhtmltopdf, last updated on 7/10/2014, is wkhtmltopdf 0.12.0-2 at this ppa:pov/wkhtmltopdf webpage: launchpad.net/~ecometrica/+archive/ubuntu/…– karelDec 23, 2015 at 3:24
Steps:
At first install xvfb serwer:
sudo apt-get install xvfb
Get needed version of wkhtmltopdf from http://wkhtmltopdf.org/downloads.html.
For Ubuntu 14.04 64-bit:
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
Install wkhtmltopdf:
sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
Install dependency (if needed):
sudo apt-get -f install
Create symblic link in
/usr/local/bin/
:echo 'exec xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf "$@"' | sudo tee /usr/local/bin/wkhtmltopdf.sh >/dev/null sudo chmod a+x /usr/local/bin/wkhtmltopdf.sh
-
Thank you for this. I didn't realize the issue I was having was I needed xvfb to run wkhtmltopdf headless. Works like a charm. Oct 15, 2015 at 1:28
-
1Please be informed that
gna.org
has been closed now. so you should download precompiled binaries from downloads.wkhtmltopdf.org . Please see github.com/wkhtmltopdf/wkhtmltopdf/issues/… Jun 16, 2017 at 4:42 -
I used the following on Ubuntu 14.04.5 LTS
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-trusty-amd64.deb
sudo apt-get install libxrender1 xfonts-utils xfonts-base xfonts-75dpi libfontenc1 x11-common xfonts-encodings libxfont1 fontconfig
sudo dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb
sudo reboot now
Note: this is version 0.12.2! So you don't have to deal with installing xvfb since you're probably not running X as it's a server.
If it fails at sudo dpkg -i wkhtmltox-0.12.2_linux-trusty-amd64.deb
then proceed with sudo apt get install -f
to install with dependencies.
-
This is very similar to Pavels' answer except that you suggest to install the dependency packages manually which prevents their later auto-removal once they cease to be in use. -1 Mar 1, 2018 at 11:49
-
@DavidFoerster it is similar, but the newer version number doesn't require xvfb which is the main difference. I don't think the downvote was necessary. Mar 9, 2018 at 5:42
Try this Solution :
Download the deb archive and install using DPKG.
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin
To install wkhtmltopdf 0.12.5 on ubuntu 16.04, try this,
Wkhtmltopdf version 0.12.5 is recommended for odoo 12.
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb
Install the package using DPKG.
sudo dpkg -i wkhtmltox_0.12.5-1.trusty_amd64.deb
This will install all dependencies.
sudo apt -f install
After trying the below command, It worked for me
cd ~
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl git-core fontconfig
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin