我正在尝试安装wkhtmltopdf,但是当我这样做时:
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
我明白了:
Preparing to unpack wkhtmltox-0.12.1_linux-trusty-amd64.deb ...
Unpacking wkhtmltox (0.12.1) over (0.12.1) ...
dpkg: dependency problems prevent configuration of wkhtmltox:
wkhtmltox depends on libjpeg-turbo8; however:
Package libjpeg-turbo8 is not installed.
dpkg: error processing package wkhtmltox (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
wkhtmltox
所以我尝试过:
apt-get update
apt-get install libjpeg-turbo8
然后我明白了
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libjpeg-turbo8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'libjpeg-turbo8' has no installation candidate
我正在使用64位debian。我浏览网页找到解决方案,但幸运的是没有找到任何答案。我怎样才能获得libjpeg-turbo8?
编辑:
所以我尝试了apt-get install wkhtmltopdf
,尽管它不被推荐。
apt-get install wkhtmltopdf
的问题是版本并不总是好的,我们应该使用0.12.1
但:
root@dev01:/opt/odoo/modules_scndf# apt-cache policy wkhtmltopdf
wkhtmltopdf:
Installed: 0.12.1-2
Candidate: 0.12.1-2
Version table:
*** 0.12.1-2 0
500 http://ftp.debian.org/debian/ jessie/main amd64 Packages
100 /var/lib/dpkg/status
即使使用apt-get install wkhtmltopdf
,版本似乎也是好的,但是当我在odoo上启动我的打印时,我仍然可以得到
Unable to find Wkhtmltopdf on this system. The report will be shown in html.
这意味着他没有按照应有的安装。
编辑2:
现在当我尝试打印报告时,我得到一个弹出窗口:
Wkhtmltopdf failed (Error code : -6). Message : The switch
--header-html, is not support using unpatched qt, and will be
ignored.The switch --footer-html, is not support using unpatched qt,
and will be ignored.QXcbConnection: Could not connect to display
Ubuntu和Debian软件包大多数时间是兼容的,但并非在所有情况下兼容,我认为这是你尝试使用Ubuntu的.deb
用于Debian而你应该获得Debian特定文件的麻烦,(它适用于两个jessie并且喘息)
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
然后在/etc/init.d/openerp-server
或/etc/init.d/odoo-server
脚本中,取决于你有哪一个
例如,将/usr/local/bin
添加到路径环境变量的前面,
PATH=/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin,
这告诉odoo在哪里查找它需要的系统二进制文件,或者你可以选择将文件复制到/usr/bin
,如果你不想弄乱那些文件
sudo cp /usr/local/bin/wkhtmlto* /usr/bin/
这对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
试试吧
sudo apt-get install -y wkhtmltopdf
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo cp /usr/local/bin/wkhtmlto* /usr/bin/
wget http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb
dpkg -i wkhtmltox-0.12.1.2_linux-jessie-amd64.deb
/etc/init.d/odoo restart
这个问题是由于破坏了wkhtmltopdf包。
您可以尝试使用以下命令安装它们 -
首先从系统中删除损坏的wkhtmltopdf。使用 -
sudo apt-get purge wkhtmltopdf
然后尝试使用以下命令 -
cd /tmp/
然后为Odoo服务器下载推荐版本的wkhtmltopdf,目前为0.12.1: -
sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
然后使用dpkg安装包: -
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
要正常运行,我们需要将二进制文件复制到适当的位置:
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
下载路径已更改为以下内容!请试试以下链接。
然后按照以下命令安装它
sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
第二选择
tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
将文件复制到/ usr / bin /并重新启动所有正在运行的Odoo服务
sudo cp ./wkhtmltox/bin/wkhtmltoimage / usr / bin /
sudo cp ./wkhtmltox/bin/wkhtmltopdf / usr / bin /
我正在使用Devuan ascii
(基于Debian stretch
),这足够了
sudo apt install wkhtmltopdf
在安装过程中,它还引入了一些Qt5软件包。没有必要将可执行文件从/usr/local/bin/
复制到/usr/bin/
,因为它已经存在了。