问题描述
我正在尝试在运行 Ubuntu 12.04.5 的 Dreamhost VPS 上安装 WKHTMLtoPDf 0.12.x.我发现了一个全新的资源看起来应该很简单:
I'm trying to install WKHTMLtoPDf 0.12.x on a Dreamhost VPS running Ubuntu 12.04.5. I found a realatively new resource and it seems like it should be pretty straight forward:
sudo add-apt-repository ppa:pov/wkhtmltopdf
sudo apt-get update
sudo apt-get install wkhtmltopdf
但是,它告诉我使用 Putty 通过 SSH 连接的用户不在 Sudoers 文件中,并且会报告该事件.
But, it tells me the user I'm SSH'd in with using Putty is not in the Sudoers file, and the incident will be reported.
这是在 Dreamhost VPS 上安装 wkhtmltopdf 的正确方法吗?如果是这样,您如何将用户添加到 sudoers 文件中?
Is this the right way to install wkhtmltopdf on the Dreamhost VPS? and if so how do you add a user to the sudoers file?
我对 SSH 命令或服务器不太了解,所以任何解释都最好在高层次上进行.
I'm not overly savy with SSH commands or servers so any explanations would be best at a high-level.
更新
Dreamhost 能够帮助我顺利进入 sudoers 列表,但上面列出的命令似乎不起作用.输入后我处于 root 状态:
Dreamhost was able to help me get on the sudoers list with no issues, but the commands listed above don't seem to work. I'm at root after typing:
sudo -s
但是现在
add-apt-repository ppa:pov/wkhtmltopdf
ERROR - add-apt-repository: command not found
和
apt-get ppa:pov/wkhtmltopdf (also tried it with just wkhtmltopdf)
ERROR - Invalid operation ppa:pov/wkhtmltopdf
我也试过
apt-get install wkhtmltopdf
安装了wkhtmltopdf,但是安装的是0.9.9.3版本,超老.我该如何更新?或者只是摆脱它?
Which installed wkhtmltopdf, but it installed version 0.9.9.3, which is super old. How do I update this? Or just get rid of it?
更新 2
为了删除包及其所有依赖项,我使用了这个资源:
To remove the package and all its dependencies I used this resource:
apt-get remove --purge wkhtmltopdf
然后按照命令提示符的建议运行 autoremove 以删除依赖项.
and then as suggested by the command prompt ran autoremove afterwards to remove the dependencies.
apt-get autoremove
更新 3
好的,所以通过协调效果这一点帮助 找到了,所以使用:
Okay, so through a coordinated effect this bit of help was found, so using:
apt-get install software-properties-common python-software-properties
我现在可以使用
add-apt-repository ppa:pov/wkhtmltopdf
这允许使用上述所有命令(如果您输入sudo -s",则减去 sudo)
And that allows the use of all the commands above (minus sudo if you typed "sudo -s")
但是现在我正坐在一个奇怪的粉红色屏幕前,它要求我安装 Grub?我不知道我该怎么办?我应该说是还是不是?为什么?
BUT now I'm sitting in front of a freaky pink screen that is asking me to install Grub? and I have no idea what I should do? Should I say yes or no? Why?
更新 4
我通过 SSH 使用另一个 shell 来检查您是否安装了 grub,然后输入:
I SSH'd in using another shell to check if you have grub installed or not and by typing:
grub-install -v
我有 1.99-21ubuntu3.17,所以我想我会拒绝,但后来它一直问我是否要安装 Grub,这显然是这个版本的 Ubuntu 的问题.所以我被迫点击是,一切似乎都在工作.
I have 1.99-21ubuntu3.17, so I thought I'd hit no, but then it just keeps asking me to if I want to install Grub, which apparently is issue with this version of Ubuntu. So I was forced to hit yes and everything seems to be working.
如果这是一个错误的决定,请告诉我.
In case this was a bad decision to hit yes let me know.
推荐答案
The steps taken to install WKHTMLtoPDF 0.12.x onto Ubuntu 12.04.5 derived from the above question, using these resources (1 and 2) where:
sudo -s
add-apt-repository ppa:pov/wkhtmltopdf
如果 add-apt-repository 不是可识别的命令:
If add-apt-repository is not a recognized command:
apt-get install software-properties-common python-software-properties
如果 add-apt-repository 是可识别的命令,或者在运行 abov 命令并重新运行第一个命令后继续:
Continue if add-apt-repository was a recognized command, or after running the abov command to and rerunning the first command:
apt-get update
apt-get install wkhtmltopdf
关于Grub,我不知道你应该选择什么.对我来说,这是因为我不能说不,并且不得不根据与 Ubuntu 相关的一些问题选择是.
With regards to Grub, I don't know what you should choose. For me it was made by the fact I couldn't say no, and had to choose yes based on some issue related to Ubuntu.
安装后运行:
wkhtmltopdf --version (should say wkhtmltopdf 0.12.1)
然后对安装进行快速测试:
and then do a quick test of the install:
wkhtmltopdf http://www.google.com google.pdf
如果这导致找不到命令的错误,您必须安装 xvfb:
If this results in a command not found error you'll have to install xvfb:
apt-get install xvfb
并运行以下命令(在此处)生成您的 PDF:
And run the command below (found here) to generate your PDFs:
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf http://www.google.com google.pdf
这篇关于在 Ubuntu 12.04.5 (Dreamhost VPS) 上安装 WKHTMLtoPDF 0.12.x 64 位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!