在 Debian 上运行 LibreOffice(你写的 liboffice 通常指 LibreOffice)一般有几种方式,下面按常见程度给你说明。
sudo apt update
sudo apt install libreoffice
如果你只想装基础组件(更轻量):
sudo apt install libreoffice-writer libreoffice-calc libreoffice-impress
libreoffice
或打开具体文件:
libreoffice example.docx
LibreOffice 支持 headless 模式,常用于文档转换:
libreoffice --headless --convert-to pdf example.docx
常见用途:
如果你的 Debian 较旧,apt 里的 LibreOffice 版本偏老:
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.libreoffice.LibreOffice
flatpak run org.libreoffice.LibreOffice
.AppImagechmod +x LibreOffice-*.AppImage
./LibreOffice-*.AppImage
确认是否安装成功:
which libreoffice
安装中文字体:
sudo apt install fonts-wqy-zenhei fonts-wqy-microhei
必须至少安装 X 相关库,或使用 headless 模式。
如果你能告诉我:
我可以给你更精确的命令。