Ubuntu LibreOffice兼容性問題解決方法匯總
舊版本LibreOffice可能存在兼容性缺陷(如無法打開新版MS Office文件、功能缺失)。通過官方倉庫或PPA更新可修復此類問題:
wget -qO- https://download.documentfoundation.org/libreoffice/KEYRING.gpg | sudo apt-key add -
sudo add-apt-repository 'deb http://download.opensuse.org/repositories/home:/pbek:/LibreOffice/Debian_$(lsb_release -sc)/ /'
sudo apt-get update
sudo apt-get install --only-upgrade libreoffice
wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.6.0/deb/x86_64/LibreOffice_7.6.0_Linux_x86-64_deb.tar.gz
tar -zxvf LibreOffice_7.6.0_Linux_x86-64_deb.tar.gz
cd LibreOffice_7.6.0_Linux_x86-64_deb/DEBS
sudo dpkg -i *.deb
LibreOffice對.docx、.xlsx等格式的支持可能存在排版錯亂(如字體、段落間距異常)。解決方法:
soffice --headless --convert-to pdf yourfile.docx --outdir ~/Downloads
若文檔中出現□□□(方框)或字體顯示異常,多為Ubuntu缺少對應中文字體(如宋體、微軟雅黑)。解決方法:
/usr/share/fonts/chinese目錄(需創建該目錄);sudo chmod -R 755 /usr/share/fonts/chinese
fc-cache -fv
若安裝或更新時出現“依賴關系不正確”錯誤(如libreoffice-help-common版本沖突),可通過以下方式解決:
/etc/apt/sources.list及/etc/apt/sources.list.d/下的第三方源(如Ubuntu Pro、backports),注釋或刪除提供沖突版本的源,然后更新:sudo apt update
sudo apt install -f
libreoffice-help-common=4:24.2.7),手動指定版本安裝:sudo apt install libreoffice-help-en-gb libreoffice-help-common=4:24.2.7-0ubuntu0.24.04.3
若兼容性問題持續存在,可選擇以下工具替代:
wps-office_2024.12.15_amd64.deb)安裝,提供與MS Office高度兼容的免費版本(部分高級功能需付費):sudo dpkg -i wps-office_2024.12.15_amd64.deb
sudo apt install -f # 修復依賴
安裝前檢查系統是否滿足LibreOffice的最低要求:
libxml2、libcurl4),避免安裝過程中出現依賴錯誤:sudo apt install libxml2 libcurl4 libpython3-dev libgl1-mesa-dev