在 Debian 下,LibreOffice(你写的 liboffice 一般指 LibreOffice)是常用的办公套件,包含 Writer(文字)、Calc(表格)、Impress(演示)等。下面从安装 → 启动 → 基本使用 → 命令行用法给你讲清楚。
sudo apt update
sudo apt install libreoffice
如果只装部分组件(更轻量):
sudo apt install libreoffice-writer # 文字
sudo apt install libreoffice-calc # 表格
sudo apt install libreoffice-impress # 演示
libreoffice
打开指定文件:
libreoffice test.docx
| 组件 | 用途 |
|---|---|
| Writer | Word 文档 |
| Calc | Excel 表格 |
| Impress | PPT 演示 |
| Draw | 绘图 |
| Math | 公式 |
操作方式与 Microsoft Office 类似:
把 docx 转 pdf:
libreoffice --headless --convert-to pdf test.docx
批量转换:
libreoffice --headless --convert-to pdf *.docx
支持格式:
libreoffice --headless --convert-to pdf --outdir ./out test.docx
Error: Please verify input parameters...
✅ 解决:确保文件存在,且使用 --headless
安装中文字体:
sudo apt install fonts-wqy-zenhei
sudo apt remove libreoffice
sudo apt autoremove
如果你是想:
可以告诉我你的使用场景,我可以给你更针对性的方案。