LibreOffice comes pre-installed on most Linux desktops, but not everyone needs it. Maybe you use Google Docs exclusively, prefer a different office suite, or simply want to reclaim disk space. This guide covers removing LibreOffice completely from Ubuntu – whether it was installed via apt, snap, or flatpak – cleaning up leftover configuration, and installing alternative office suites if you need one.
Remove LibreOffice Installed via apt
On Ubuntu versions that ship LibreOffice as a deb package (or if you installed it manually via apt), remove it with purge to also delete configuration files:
sudo apt purge -y libreoffice*
Clean up any orphaned dependencies that were only needed by LibreOffice:
sudo apt autoremove -y
Verify LibreOffice is gone:
dpkg -l | grep libreoffice
If the output is empty or shows only “rc” (removed but config remains) entries, the removal was successful. Clear the residual config entries:
dpkg -l | grep "^rc" | awk '{print $2}' | xargs sudo dpkg --purge
Remove the Snap Version of LibreOffice
Ubuntu 24.04 ships LibreOffice as a snap package by default. The apt purge command above will not touch the snap version. Check if the snap is installed:
snap list | grep libreoffice
If listed, remove it:
sudo snap remove libreoffice
Verify removal:
snap list | grep libreoffice
The command should return no output. Snap automatically cleans up the data directory, but you can verify no leftover snap data remains:
ls ~/snap/libreoffice 2>/dev/null && echo "Snap data found" || echo "Clean"
Remove the Flatpak Version of LibreOffice
If you installed LibreOffice via Flatpak, remove it with:
flatpak uninstall org.libreoffice.LibreOffice
Remove unused Flatpak runtimes that may have been pulled in as dependencies:
flatpak uninstall --unused
Verify:
flatpak list | grep -i libre
Clean Up User Configuration
LibreOffice stores user settings, custom dictionaries, and templates in your home directory. These persist after package removal. Delete them if you do not plan to reinstall:
rm -rf ~/.config/libreoffice
Also check for recent documents cache:
rm -rf ~/.local/share/recently-used.xbel
Verify the config directory is gone:
ls ~/.config/libreoffice 2>/dev/null && echo "Config remains" || echo "Clean"
Install Alternative Office Suites
If you still need an office suite but want something other than LibreOffice, here are the main options.
OnlyOffice Desktop Editors
OnlyOffice focuses on Microsoft Office compatibility. Its document rendering is closer to Word/Excel/PowerPoint than most alternatives. Install via Flatpak:
flatpak install flathub org.onlyoffice.desktopeditors
Or download the deb package from the OnlyOffice website and install it:
wget https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb
sudo apt install -y ./onlyoffice-desktopeditors_amd64.deb
Launch it from the application menu and verify it opens correctly.
FreeOffice
FreeOffice by SoftMaker is a lightweight suite with strong .docx/.xlsx/.pptx support. Download the deb package from the SoftMaker website:
wget https://www.freeoffice.com/download.php?filename=softmaker-freeoffice-2024_amd64.deb -O freeoffice.deb
sudo apt install -y ./freeoffice.deb
Register for a free product key on the SoftMaker website (required for activation). Launch FreeOffice and enter the key when prompted.
WPS Office
WPS Office provides a familiar interface that closely mimics Microsoft Office. Download the deb package from the WPS website:
wget https://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/11723/wps-office_11.1.0.11723.XA_amd64.deb
sudo apt install -y ./wps-office_*.deb
Note that WPS Office is free for personal use but includes ads in the free version. A paid subscription removes them.
Google Docs (Browser-Based)
If you primarily work with documents online and collaborate with others, Google Docs may be all you need. No installation required – access it at docs.google.com. For offline access, install the Google Docs Offline extension in Chrome/Chromium. This is the lightest option since it uses zero local disk space for the application itself.
Reinstall Specific LibreOffice Components
If you removed LibreOffice entirely but realize you need just one component (say, the spreadsheet), you do not have to reinstall the full suite. Install individual components via apt:
# Calc only (spreadsheet)
sudo apt install -y libreoffice-calc
# Writer only (word processor)
sudo apt install -y libreoffice-writer
# Impress only (presentations)
sudo apt install -y libreoffice-impress
# Draw only (vector graphics)
sudo apt install -y libreoffice-draw
Verify the specific component installed:
dpkg -l | grep libreoffice-calc
Note that the snap version installs as a single package – you cannot install individual components from the snap. Use the apt method for selective installation.
Wrapping Up
Removing LibreOffice on Ubuntu requires checking all three package sources – apt, snap, and flatpak – since the suite may have been installed through any of them. Cleaning up the user config directory completes the removal. If you need an office suite afterward, OnlyOffice and FreeOffice both offer strong Microsoft Office compatibility, while Google Docs works well for anyone who lives in the browser. And if you change your mind, you can always reinstall just the LibreOffice components you actually use rather than the full suite.
You probably want to autoremove before cleaning.
Cleaning is the last step.
(BTW, note that cleaning is just useless in case of uninstallation… it just removes the installation cache files in /var/cache/apt/archives)
how to uninstall libreoffice if there are two versions of libreoffice installed, for example libreoffice 7.4 and 7.5
You need to upgrade or uninstall?