CentOS系统LibreOffice兼容性问题解析及解决方法
libX11-devel、libpng-devel等),导致安装失败或功能异常。cat /etc/redhat-release查看CentOS版本(如CentOS 7、CentOS 8),确保选择的LibreOffice版本与之兼容。/etc/yum.repos.d/libreoffice.repo文件,内容如下:[libreoffice]
name=LibreOffice repository for $basearch
baseurl=https://download.libreoffice.org/download/libreoffice/releng/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://download.libreoffice.org/repo/key.asc
type=rpm-md
清除缓存并安装:sudo yum clean all && sudo yum install libreoffice。sudo yum install -y wget fontconfig urw-fonts libX11-devel libXext-devel libXrender-devel libjpeg-turbo-devel libpng-devel libtiff-devel gstreamer1.0-devel
sudo yum remove libreoffice*
sudo yum install libreoffice
ttf-dejavu-fonts或Windows字体(如方正、微软雅黑):sudo yum install -y ttf-dejavu-fonts # 安装开源中文字体
或手动安装Windows字体(以方正字体为例):sudo mv /path/to/xpfonts /usr/share/fonts/ # 复制字体文件夹到系统目录
sudo chmod -R u+rw /usr/share/fonts/xpfonts # 赋予读写权限
cd /usr/share/fonts/xpfonts
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv # 更新字体缓存
libreoffice --headless --convert-to html /path/to/document.docx
sudo yum update && sudo yum update libreoffice
soffice --headless --nofirststartwizard
~/.config/libreoffice/4/user/log/目录下的日志文件,定位崩溃原因(如缺少库、插件冲突)。sudo yum remove libreoffice*
sudo rm -rf ~/.config/libreoffice/
sudo yum install libreoffice
sudo yum install -y flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.libreoffice.LibreOffice
sudo snap install libreoffice --classic