How to correctly install wkhtmltopdf on debian 64 bit?

Ubuntu and Debian packages are compatible most times but not in all cases, i think this is the trouble you're having you're trying to use the Ubuntu's .deb for Debian instead you should get the Debian specific file, (it works for both jessie and wheezy)

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-wheezy-amd64.deb
sudo dpkg -i  wkhtmltox-0.12.1_linux-wheezy-amd64.deb

Then in the /etc/init.d/openerp-server or /etc/init.d/odoo-server script(s), depending on your which one you have

add /usr/local/bin to the front of path environment variable for example,

PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin, 

This tells odoo where to look for system binaries it requires or optionally you can copy the files to /usr/bin, if you don't want to mess with those files

sudo cp /usr/local/bin/wkhtmlto* /usr/bin/

Download page for wkhtmltopdf: https://wkhtmltopdf.org/downloads.html


That's works for me in Debian Stretch:

$ sudo apt-get -q update
$ sudo apt-get -qy install --no-install-recommends wget
$ wget -nv -O /tmp/wkhtmltox.deb https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb
$ sudo apt-get -qy install /tmp/wkhtmltox.deb

I was trying to use wkhtmltopdf with an existing debian based docker image. But I faced

Package libjpeg-turbo8 is not installed

Finally I fixed this by installating libjpeg-turbo8 using dpkg. Below are the docker commands:

ARG  jpeg=libjpeg-dev
ARG  ssl=libssl-dev
ENV  CFLAGS=-w CXXFLAGS=-w

RUN apt-get update && apt-get install -y -q --no-install-recommends \
    build-essential \
    libfontconfig1-dev \
    libfreetype6-dev \
    $jpeg \
    libpng-dev \
    $ssl \
    libx11-dev \
    libxext-dev \
    libxrender-dev \
    python \
    zlib1g-dev \
    xfonts-75dpi \
    xfonts-base \
    && rm -rf /var/lib/apt/lists/*
RUN wget http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_2.0.6-0ubuntu2_amd64.deb
RUN dpkg -i libjpeg-turbo8_2.0.6-0ubuntu2_amd64.deb
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
RUN dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
RUN apt --fix-broken install

I'm running Debian Stretch 9.2 64bit and I succeeded with the following:

    sudo apt update
    sudo apt install xfonts-75dpi xfonts-base gvfs colord glew-utils libvisual-0.4-plugins gstreamer1.0-tools opus-tools qt5-image-formats-plugins qtwayland5 qt5-qmltooling-plugins librsvg2-bin lm-sensors 
    sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb
    sudo dpkg -i wkhtmltox_0.12.5-1.stretch_amd64.deb
    sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/
    sudo cp /usr/local/bin/wkhtmltoimage /usr/bin/

Then check the installation with:

    wkhtmltopdf -V

Which should return:

    wkhtmltopdf 0.12.5 (with patched qt)