在 Debian 上 LibreOffice(你写的 liboffice 通常是 libreoffice)可以通过几种方式启动,下面按常见情况说明:
libreoffice
或
soffice
libreoffice --writer # 文字
libreoffice --calc # 表格
libreoffice --impress # 演示
libreoffice --draw # 绘图
libreoffice --base # 数据库
libreoffice 文档.docx
libreoffice 表格.xlsx
如果你安装了桌面环境(GNOME / KDE / XFCE 等):
which libreoffice
或
dpkg -l | grep libreoffice
如果未安装:
sudo apt update
sudo apt install libreoffice
可能是只装了部分组件:
sudo apt install libreoffice-writer libreoffice-calc
可无头运行:
libreoffice --headless --convert-to pdf 文档.docx
如果你是在 服务器 / 容器 / 特定桌面环境,可以告诉我具体场景,我可以给更精确的命令。