4

I am unable to install wkhtmltopdf on Ubuntu 14.4. I downloaded from wkhtmltopdf Linux (Ubuntu Trusty) 64 bit. I ran the following command:

sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb

Here's the log

(Reading database ... 61662 files and directories currently installed.)
Preparing to unpack wkhtmltox-0.12.2.1_linux-trusty-amd64.deb ...
Unpacking wkhtmltox (0.12.2.1) over (0.12.2.1) ...
dpkg: dependency problems prevent configuration of wkhtmltox:
 wkhtmltox depends on fontconfig; however:
  Package fontconfig is not installed.
 wkhtmltox depends on libjpeg-turbo8; however:
  Package libjpeg-turbo8 is not installed.
 wkhtmltox depends on xfonts-base; however:
  Package xfonts-base is not installed.
 wkhtmltox depends on xfonts-75dpi; however:
  Package xfonts-75dpi is not installed.

dpkg: error processing package wkhtmltox (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.6.7.1-1) ...
Errors were encountered while processing:
 wkhtmltox

I searched but could not find anything specific. What am I missing here?

5
  • Do you really need 0.12.2? I ask because wkhtmltopdf 0.9.9 is already in the ubuntu repo for trusty: packages.ubuntu.com/trusty/wkhtmltopdf Jul 22, 2015 at 8:07
  • 2
    see askubuntu.com/questions/40011/… on how to install dependencies.
    – Rinzwind
    Jul 22, 2015 at 8:08
  • Yes i need the latest version
    – bitkot
    Jul 22, 2015 at 8:20
  • @rinzwind will try that
    – bitkot
    Jul 22, 2015 at 8:21
  • @user1629362 alternative: download the DEBs it complains about and "dpkg" those 1st (dpkg does not solve dependencies for you).
    – Rinzwind
    Jul 22, 2015 at 8:23

1 Answer 1

11

first of all, if you don't care about version, you can install the package founded in the official Ubuntu repos:

sudo apt-get install wkhtmltopdf

But if you want to install your specific version above(0.12.2) you should resolve the package dependencies.

first try to run the command:

sudo apt-get install -f

If this solves it then ok else you have to install each dependency yourself.

dpkg: dependency problems prevent configuration of wkhtmltox:
 wkhtmltox depends on fontconfig; however:
  Package fontconfig is not installed.
 wkhtmltox depends on libjpeg-turbo8; however:
  Package libjpeg-turbo8 is not installed.
 wkhtmltox depends on xfonts-base; however:
  Package xfonts-base is not installed.
 wkhtmltox depends on xfonts-75dpi; however:
  Package xfonts-75dpi is not installed.

From above you can install each dependency yourself

sudo apt-get install fontconfig
sudo apt-get install libjpeg-turbo8
sudo apt-get install xfonts-base
sudo apt-get install xfonts-75dpi

But an easier solution is to use gdebi.

sudo apt-get install gdebi

then you can use it to resolve dependencies:

sudo gdebi wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
2
  • Where is it installed then? -bash: /usr/bin/wkhtmltopdf: No such file or directory
    – itsazzad
    Nov 6, 2015 at 17:55
  • Got it: /usr/local/bin/wkhtmltopdf and: /usr/local/bin/wkhtmltoimage
    – itsazzad
    Nov 6, 2015 at 17:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.