我在Debian Jessie上
我通过apt-get install安装了wkhtmltopdf。
这安装了旧版本,所以我:
wget
下载此文件:https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.jessie_amd64.deb dpkg -i
apt-get install -f
修复现在,当我尝试执行时,出现以下错误:
root@Debian-86-jessie-64-LAMP / # wkhtmltopdf -V
-bash: /usr/bin/wkhtmltopdf: No such file or directory
但是文件位于/usr/local/bin
中:
root@Debian-86-jessie-64-LAMP / # which wkhtmltopdf
/usr/local/bin/wkhtmltopdf
root@Debian-86-jessie-64-LAMP / # dpkg -L wkhtmltox
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/wkhtmltox
/usr/share/doc/wkhtmltox/changelog.gz
/usr/local
/usr/local/include
/usr/local/include/wkhtmltox
/usr/local/include/wkhtmltox/image.h
/usr/local/include/wkhtmltox/pdf.h
/usr/local/include/wkhtmltox/dllbegin.inc
/usr/local/include/wkhtmltox/dllend.inc
/usr/local/share
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man1/wkhtmltopdf.1.gz
/usr/local/share/man/man1/wkhtmltoimage.1.gz
/usr/local/bin
/usr/local/bin/wkhtmltopdf
/usr/local/bin/wkhtmltoimage
/usr/local/lib
/usr/local/lib/libwkhtmltox.so.0.12.5
/usr/local/lib/libwkhtmltox.so.0.12
/usr/local/lib/libwkhtmltox.so
/usr/local/lib/libwkhtmltox.so.0
$PATH
看起来像这样:
root@Debian-86-jessie-64-LAMP / # echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
我忘记了什么?
编辑:当我使用完整路径调用程序时,它会起作用。
这是dpkg -i和apt-get install -f的输出,只是为了使信息完整:(由于某种原因,无法将其添加到上面的编号列表中)。
root@Debian-86-jessie-64-LAMP / # dpkg -i wkhtmltox_0.12.5-1.jessie_amd64.deb
Selecting previously unselected package wkhtmltox.
dpkg: considering removing wkhtmltopdf in favour of wkhtmltox ...
dpkg: yes, will remove wkhtmltopdf in favour of wkhtmltox
(Reading database ... 63718 files and directories currently installed.)
Preparing to unpack wkhtmltox_0.12.5-1.jessie_amd64.deb ...
Unpacking wkhtmltox (1:0.12.5-1.jessie) ...
dpkg: dependency problems prevent configuration of wkhtmltox:
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.7.0.2-5) ...
Errors were encountered while processing:
wkhtmltox
root@Debian-86-jessie-64-LAMP / # apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
hicolor-icon-theme iso-codes libatk1.0-0 libatk1.0-data libavahi-client3
libavahi-common-data libavahi-common3 libcairo2 libcups2 libdatrie1 libegl1-
mesa libegl1-mesa-drivers libgbm1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common
libgraphite2-3 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0
libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz0b libjasper1
libmtdev1 libopenvg1-mesa liborc-0.4-0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5sql5 libqt5sql5-sqlite libqt5svg5 libqt5webkit5 libqt5widgets5 libqt5xmlpatterns5 libthai-data libthai0
libwayland-client0 libwayland-egl1-mesa libwayland-server0 libwebp5 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-util0 libxcb-xfixes0 libxcb-xkb1
libxcomposite1 libxcursor1 libxi6 libxinerama1 libxkbcommon-x11-0 libxkbcommon0 libxrandr2 libxslt1.1 qttranslations5-l10n
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
xfonts-75dpi
The following NEW packages will be installed:
xfonts-75dpi
0 upgraded, 1 newly installed, 0 to remove and 175 not upgraded.
1 not fully installed or removed.
Need to get 3,476 kB of archives.
After this operation, 4,596 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirror.hetzner.de/debian/packages/ jessie/main xfonts-75dpi all
1:1.0.3 [3,476 kB]
Fetched 3,476 kB in 0s (46.8 MB/s)
Selecting previously unselected package xfonts-75dpi.
(Reading database ... 63729 files and directories currently installed.)
Preparing to unpack .../xfonts-75dpi_1%3a1.0.3_all.deb ...
Unpacking xfonts-75dpi (1:1.0.3) ...
Processing triggers for fontconfig (2.11.0-6.3+deb8u1) ...
Setting up xfonts-75dpi (1:1.0.3) ...
Setting up wkhtmltox (1:0.12.5-1.jessie) ...
root@Debian-86-jessie-64-LAMP / #