Need clarification on the pre-installed LibreOffice package

I prefer using the Flathub release (also the Flatpak is verified by libreoffice.org anyway).

If I want to remove the Fedora package with NO LEFTOVERS, what is the ideal way of doing so?

I’ve seen these two commands from various sources. Do they behave any differently from each other?

sudo dnf remove -y libreoffice*

or

sudo dnf group remove -y libreoffice

Yes a little bit.

LibreOffice is installed via group.
(It’s strange that LibreOffice is explicitly marked since it’s in Fedora Workstation env group anyway.)

$ dnf repoquery --installed --qf='%{name} (&{reason})' libreoffice*
libreoffice-calc (group)
...

$ dnf group list --installed
...
Installed Groups:
   LibreOffice

$ dnf group info LibreOffice
Group: LibreOffice
 Description: LibreOffice Productivity Suite
 Mandatory Packages:
   libreoffice-calc
   libreoffice-emailmerge
   libreoffice-graphicfilter
   libreoffice-impress
   libreoffice-writer
 Optional Packages:
   libreoffice-base
   libreoffice-draw
   libreoffice-math
   libreoffice-pyuno

sudo dnf remove -y libreoffice* removes all packages installed in the group, but does not remove the group.
sudo dnf group remove -y libreoffice removes the group. It should remove the packages, but unoconv in the @workstation-product (Why… :melting_face:) depends on libreoffice-* stuff so they become dependency instead.

$ dnf repoquery --installed --whatdepends libreoffice-calc
libreoffice-filters-1:7.6.2.1-2.fc39.x86_64
$ dnf repoquery --installed --whatdepends libreoffice-filters
unoconv-0:0.9.0-12.fc39.noarch
$ dnf repoquery --installed --whatdepends unoconv

$ sudo dnf remove @libreoffice
...
$ dnf repoquery --installed --qf='%{name} (&{reason})' libreoffice*
libreoffice-calc (dependency)

Nothing depends on unoconv so that can be uninstalled to make all the dependencies go away.

So, I would just do this to kinda peel things off correctly:

$ sudo dnf remove unoconv
$ sudo dnf remove @libreoffice
1 Like

https://pagure.io/fedora-comps/c/3110cba670fc3a29e704ed15059bf3fd1f9bddd6

That was apparently added for gnome-documents, which is long dead. It probably could be dropped now.

2 Likes

So then I assume @libreoffice is just a shorthand for specifying that the input passed to dnf is a group name.

(I’m still quite new to Fedora and DNF)

I almost forgot to mention. Some guides/answers I saw included the command sudo dnf remove libreoffice-core.

This package isn’t mentioned in your reply. Can I include this? Or perhaps I should run autoremove as the last command to wipe leftovers?

Yes.[1]

$ dnf -v group info "LibreOffice"
...
 Group-Id: libreoffice

dnf removes dependencies by default[2], libreoffice-core is already in the removed dependencies list (last time I checked).


  1. @<group-spec> ↩︎

  2. If clean_requirements_on_remove is enabled (the default), also removes any dependencies that are no longer needed. ↩︎