Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux 徹底移除 LibreOffice:apt-get purge 通配符清除所有殘留套件

編輯:關於 Linux

Ubuntu/Debian 系統中,單純 apt-get remove libreoffice 常留下大量 libreoffice-* 相關套件(語言包、擴充套件、核心模組)。需使用 purge 搭配通配符一次清除乾淨。

LibreOffice 移除示意圖

完整移除指令

# 方法一:apt-get purge + 通配符 (推薦)
sudo apt-get purge 'libreoffice*'

# 方法二:aptitude purge (互動式確認)
sudo aptitude purge 'libreoffice*'

# 方法三:apt-get remove --purge (等同 purge)
sudo apt-get remove --purge 'libreoffice*'
⚠ 關鍵: 單引號包裹通配符 'libreoffice*' 防止 Shell 擴展,讓 apt 內部匹配套件名稱。若無引號,Shell 會嘗試匹配當前目錄檔案導致失敗。

執行後清理

# 移除不再需要的相依套件
sudo apt-get autoremove

# 清理套件快取
sudo apt-get autoclean

# 驗證已無 libreoffice 套件
dpkg -l | grep -i libreoffice
# 應無輸出

常見殘留檔案位置 (手動檢查)

  • /usr/lib/libreoffice/
  • /usr/share/libreoffice/
  • /etc/libreoffice/
  • ~/.config/libreoffice/ (使用者設定,apt 不會刪除)

重新安裝建議

若需重裝最新版,建議加入官方 PPA:

sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice

使用 purge 'libreoffice*' 能一次性清除所有相關套件與系統層級設定檔,避免版本升級殘留衝突,是 Linux 桌面維護的基本功。

Copyright © Windows教程網 All Rights Reserved