我正在尝试将Word文档转换为纯文本,并出现以下错误:

user@server$ unoconv --format=txt test.docx
/usr/lib64/libreoffice/program/soffice.bin X11 error: Can't open display:
    Set DISPLAY environment variable, use -display option
    or check permissions of your X-Server
    (See "man X" resp. "man xhost" for details)
Error: Unable to connect or start own listener. Aborting.

这个服务器上的libreoffice版本是libreoffice 4.3.7.2430(内部版本:2),它运行的是centos 7。
因此,我在自己的计算机上的VirtualBox中安装了Debian8.3.0(因为我在CentOS计算机上没有根权限),并附带了Libreoffice4.3.3.2 430M0(内部版本:2)。令我惊讶的是,当我尝试通过ssh转换ms-word文件时,它仍然有效,而x根本没有运行。
有人知道我怎么在centos上工作吗?是否需要更新libreoffice(即使它从未超过我在debian机器上的版本)?

最佳答案

原来需要无头的Libreoffice。我是用Yum安装的。

关于linux - 没有X,无法使unoconv正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36328124/

10-13 05:08