Where is LibreOffice installed and how to delete LibreOffice packages?

I have both LibreOffice 24.8.5.2 and LibreOffice 25.2.1.2 installed. I installed 25.2.1.2 this morning.

Now I want to remove 24.8.5.2. Here is what I see.

$ which soffice
/usr/bin/soffice
$
$ ls -l /usr/bin/soffice
lrwxrwxrwx. 1 root root 38 Feb 19 16:00 /usr/bin/soffice -> /usr/lib64/libreoffice/program/soffice
$
$ soffice --version
LibreOffice 24.8.5.2 480(Build:2)

$

I can’t find where version 25.2.1.2 is installed. I can start it from the Application Launcher. But if I either double-click or right-click on a file it starts up version 24.

Here is some more info:

$ rpm --query --all | grep -i libreoffice
libreoffice-data-24.8.5.2-1.fc41.x86_64
libreoffice-ure-common-24.8.5.2-1.fc41.x86_64
libreoffice-ure-24.8.5.2-1.fc41.x86_64
libreoffice-opensymbol-fonts-24.8.5.2-1.fc41.noarch
libreoffice-kf6-24.8.5.2-1.fc41.x86_64
libreoffice-core-24.8.5.2-1.fc41.x86_64
libreoffice-langpack-en-24.8.5.2-1.fc41.x86_64
libreoffice-pyuno-24.8.5.2-1.fc41.x86_64
libreoffice-pdfimport-24.8.5.2-1.fc41.x86_64
libreoffice-ogltrans-24.8.5.2-1.fc41.x86_64
libreoffice-graphicfilter-24.8.5.2-1.fc41.x86_64
libreoffice-writer-24.8.5.2-1.fc41.x86_64
libreoffice-emailmerge-24.8.5.2-1.fc41.x86_64
libreoffice-impress-24.8.5.2-1.fc41.x86_64
libreoffice-draw-24.8.5.2-1.fc41.x86_64
libreoffice-calc-24.8.5.2-1.fc41.x86_64
libreoffice-math-24.8.5.2-1.fc41.x86_64
libreoffice-help-en-24.8.5.2-1.fc41.x86_64
libreoffice-gtk4-24.8.5.2-1.fc41.x86_64
libreoffice-gtk3-24.8.5.2-1.fc41.x86_64
libreoffice-base-24.8.5.2-1.fc41.x86_64
libreoffice-24.8.5.2-1.fc41.x86_64
libreoffice25.2-ure-25.2.1.2-2.x86_64
libreoffice25.2-25.2.1.2-2.x86_64
libreoffice25.2-math-25.2.1.2-2.x86_64
libreoffice25.2-base-25.2.1.2-2.x86_64
libreoffice25.2-calc-25.2.1.2-2.x86_64
libreoffice25.2-dict-en-25.2.1.2-2.x86_64
libreoffice25.2-dict-es-25.2.1.2-2.x86_64
libreoffice25.2-dict-fr-25.2.1.2-2.x86_64
libreoffice25.2-draw-25.2.1.2-2.x86_64
libreoffice25.2-en-US-25.2.1.2-2.x86_64
libreoffice25.2-impress-25.2.1.2-2.x86_64
libreoffice25.2-writer-25.2.1.2-2.x86_64
libobasis25.2-libreofficekit-data-25.2.1.2-2.x86_64
libreoffice25.2-freedesktop-menus-25.2.1-2.noarch
$

I guess the above means that here are rpm versions of both 24 and 25 installed? And I see version 25 in dnf packages but no version 24.

$ dnf list | grep libreoffice24
Updating and loading repositories:
Repositories loaded.
$
$
$ dnf list | grep libreoffice25
Updating and loading repositories:
Repositories loaded.
libreoffice25.2.x86_64                                                                   25.2.1.2-2                                                                      @commandline
libreoffice25.2-base.x86_64                                                              25.2.1.2-2                                                                      @commandline
libreoffice25.2-calc.x86_64                                                              25.2.1.2-2                                                                      @commandline
libreoffice25.2-dict-en.x86_64                                                           25.2.1.2-2                                                                      @commandline
libreoffice25.2-dict-es.x86_64                                                           25.2.1.2-2                                                                      @commandline
libreoffice25.2-dict-fr.x86_64                                                           25.2.1.2-2                                                                      @commandline
libreoffice25.2-draw.x86_64                                                              25.2.1.2-2                                                                      @commandline
libreoffice25.2-en-US.x86_64                                                             25.2.1.2-2                                                                      @commandline
libreoffice25.2-freedesktop-menus.noarch                                                 25.2.1-2                                                                        @commandline
libreoffice25.2-impress.x86_64                                                           25.2.1.2-2                                                                      @commandline
libreoffice25.2-math.x86_64                                                              25.2.1.2-2                                                                      @commandline
libreoffice25.2-ure.x86_64                                                               25.2.1.2-2                                                                      @commandline
libreoffice25.2-writer.x86_64                                                            25.2.1.2-2                                                                      @commandline
$

More output:

$
$ dnf list extras
Updating and loading repositories:
Repositories loaded.
No matching packages to list
$

So I guess I should use rpm commands to remove all the version 24 packages. But I’m not sure what command to execute to do so.

Thinking about it… I’m not even sure when/how LibreOffice 24 was installed…

try ls /usr/lib64/libreoffice/program/

That’s where version 24 is installed. I showed this output in my original post.

I am trying to figure out how to cleanly uninstall it.

And I’m trying to figure out where version 25 is installed just so I understand how to ensure it’s in my PATH.

Check with the software app if you have gnome.

You still can use the dnf4 command to see if it has been installed in F40 when we still used dnf4.

For libreoffice 24 you are searching the wrong way. "libreoffice-*" would be the correct one. It has no 24 direct on the first part of the package name.

so you might search first

dnf list | grep libreoffice-*

1 Like

My desktop was a fresh install of Fedora 41; I never had 40.
I’m running KDE, not Gnome.

$ dnf list | grep -i "libreoffice-24"
Updating and loading repositories:
Repositories loaded.
$ 

I guess no LibreOffice 24 installed via dnf. But for sure it’s installed via rpm packages. I believe that came when I did my initial installation of Fedora 41 as I never use rpm.

When searching locally installed packages (rather than for ones that might be available in online repos), I use rpm -qa | grep -i <whatever>. (q=query, a=all) (In this case, I would substitute <whatever> with office.)


Edit:

You can also search for locally installed packages by providing rpm with the full path to the file. For example: rpm -qf /usr/lib64/libreoffice. (q=query, f=file)

2 Likes

If you want to go the other way around and find out where a package’s files are stored, you can use rpm -ql <package-name>. For example: rpm -ql libreoffice25.2-writer-25.2.1.2-2.x86_64. (q=query, l=list)

RPM (normally) shouldn’t allow two packages to “own” the same file. If you find that situation, you might need to uninstall and reinstall things to fix it.

What is the right command in this case to remove specific rpm packages? Here is the output again showing both version 24 and version 25 rpm packages.

$ rpm -qa | grep -i office
libstaroffice-0.0.7-14.fc41.x86_64
libreoffice-data-24.8.5.2-1.fc41.x86_64
libreoffice-ure-common-24.8.5.2-1.fc41.x86_64
libreoffice-ure-24.8.5.2-1.fc41.x86_64
libreoffice-opensymbol-fonts-24.8.5.2-1.fc41.noarch
libreoffice-kf6-24.8.5.2-1.fc41.x86_64
libreoffice-core-24.8.5.2-1.fc41.x86_64
libreoffice-langpack-en-24.8.5.2-1.fc41.x86_64
libreoffice-pyuno-24.8.5.2-1.fc41.x86_64
libreoffice-pdfimport-24.8.5.2-1.fc41.x86_64
libreoffice-ogltrans-24.8.5.2-1.fc41.x86_64
libreoffice-graphicfilter-24.8.5.2-1.fc41.x86_64
libreoffice-writer-24.8.5.2-1.fc41.x86_64
libreoffice-emailmerge-24.8.5.2-1.fc41.x86_64
libreoffice-impress-24.8.5.2-1.fc41.x86_64
libreoffice-draw-24.8.5.2-1.fc41.x86_64
libreoffice-calc-24.8.5.2-1.fc41.x86_64
libreoffice-math-24.8.5.2-1.fc41.x86_64
libreoffice-help-en-24.8.5.2-1.fc41.x86_64
libreoffice-gtk4-24.8.5.2-1.fc41.x86_64
libreoffice-gtk3-24.8.5.2-1.fc41.x86_64
libreoffice-base-24.8.5.2-1.fc41.x86_64
libreoffice-24.8.5.2-1.fc41.x86_64
libreoffice25.2-ure-25.2.1.2-2.x86_64
libreoffice25.2-25.2.1.2-2.x86_64
libreoffice25.2-math-25.2.1.2-2.x86_64
libreoffice25.2-base-25.2.1.2-2.x86_64
libreoffice25.2-calc-25.2.1.2-2.x86_64
libreoffice25.2-dict-en-25.2.1.2-2.x86_64
libreoffice25.2-dict-es-25.2.1.2-2.x86_64
libreoffice25.2-dict-fr-25.2.1.2-2.x86_64
libreoffice25.2-draw-25.2.1.2-2.x86_64
libreoffice25.2-en-US-25.2.1.2-2.x86_64
libreoffice25.2-impress-25.2.1.2-2.x86_64
libreoffice25.2-writer-25.2.1.2-2.x86_64
libobasis25.2-libreofficekit-data-25.2.1.2-2.x86_64
libreoffice25.2-freedesktop-menus-25.2.1-2.noarch
$ 

Further, looking at the above package list, I’m even sure which ones to uninstall. The following look like good candidates, but do they constitute all packages for version 24?

$ rpm -qa | grep -i office | grep 24
libreoffice-data-24.8.5.2-1.fc41.x86_64
libreoffice-ure-common-24.8.5.2-1.fc41.x86_64
libreoffice-ure-24.8.5.2-1.fc41.x86_64
libreoffice-opensymbol-fonts-24.8.5.2-1.fc41.noarch
libreoffice-kf6-24.8.5.2-1.fc41.x86_64
libreoffice-core-24.8.5.2-1.fc41.x86_64
libreoffice-langpack-en-24.8.5.2-1.fc41.x86_64
libreoffice-pyuno-24.8.5.2-1.fc41.x86_64
libreoffice-pdfimport-24.8.5.2-1.fc41.x86_64
libreoffice-ogltrans-24.8.5.2-1.fc41.x86_64
libreoffice-graphicfilter-24.8.5.2-1.fc41.x86_64
libreoffice-writer-24.8.5.2-1.fc41.x86_64
libreoffice-emailmerge-24.8.5.2-1.fc41.x86_64
libreoffice-impress-24.8.5.2-1.fc41.x86_64
libreoffice-draw-24.8.5.2-1.fc41.x86_64
libreoffice-calc-24.8.5.2-1.fc41.x86_64
libreoffice-math-24.8.5.2-1.fc41.x86_64
libreoffice-help-en-24.8.5.2-1.fc41.x86_64
libreoffice-gtk4-24.8.5.2-1.fc41.x86_64
libreoffice-gtk3-24.8.5.2-1.fc41.x86_64
libreoffice-base-24.8.5.2-1.fc41.x86_64
libreoffice-24.8.5.2-1.fc41.x86_64
$ 

And are there any in there that I should not uninstall? I guess these last questions might be more appropriate for a LibreOffice forum. But I started here because I first want to understand the interaction, relationship, or interference if any between dnf and rpm.

Ah, thanks…! Just ran that command. It’s installed in /opt…!

$ rpm -ql libreoffice25.2-writer.x86_64
/opt/libreoffice25.2
/opt/libreoffice25.2/program
/opt/libreoffice25.2/program/swriter
$ 
1 Like

That command looks OK to me. If you use dnf, it will verify that there are no other packages that need them and if there are, it will add the other packages to the list. So if you want to remove those packages, I would run dnf interactively with the following command:

$ sudo dnf remove $(rpm -qa | grep -i office | grep 24)

It will show a list of all the packages that will be removed, and as long as it doesn’t show more than you intend, you can answer y to proceed.

1 Like

I think you must have obtained that package from a non-Fedora repo. Fedora keeps (most) of its content under /usr.

Don’t I need to remove LibreOffice 24 packages using rpm? Only rpm shows version 24 packages; dnf shows no packages for version 24 LibreOffice.

Possibly. I just can’t recall now.

The libreoffice25 packages don’t seem to originate from Fedora repos. This is also confirmed by the fact that those packages are lacking the fc41 suffix in the version/release.

You can probably confirm that the package was downloaded as RPM directly from LibreOffice’s downloads page. There is no guarantee that those packages have been thoroughly tested with F41 though.

I would stay on version 24 for now, given that F42 will be delivered with version 25:

$ dnf list libreoffice-base* --releasever=42
Updating and loading repositories:
Repositories loaded.
Available packages
libreoffice-base.x86_64 1:25.2.2.2-1.fc42 fedora

Alternatively, you could install version 25 as Flatpak:

$ flatpak remote-info flathub org.libreoffice.LibreOffice

LibreOffice - The LibreOffice productivity suite

        ID: org.libreoffice.LibreOffice
       Ref: app/org.libreoffice.LibreOffice/x86_64/stable
      Arch: x86_64
    Branch: stable
   Version: 25.2.1.2
   License: MPL-2.0
Collection: org.flathub.Stable
  Download: 321.0 MB
 Installed: 793.7 MB
   Runtime: org.freedesktop.Platform/x86_64/24.08
       Sdk: org.freedesktop.Sdk/x86_64/24.08
3 Likes

Oh. I see. I’m not sure how that could happen short of the dnf4/dnf5 confusion. You can use rpm. It’s just a little less safe because I think it will automatically remove dependent packages without warning unless you add --nodeps (which is also a little unsafe for other reasons).

Does dnf4 find the packages?

If you use rpm to erase packages, I would also add -v (verbose) so you will know exactly what it removed. There might be a “dry run” option as well, but I’ve never used it.

OK, I just tried this, using one of the packages listed in the output from “rpm -qa | grep -i office | grep 24” :

$ rpm --erase --test libreoffice-data-24.8.5.2-1.fc41.x86_64
error: Failed dependencies:
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-core-1:24.8.5.2-1.fc41.x86_64
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-graphicfilter-1:24.8.5.2-1.fc41.x86_64
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-writer-1:24.8.5.2-1.fc41.x86_64
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-impress-1:24.8.5.2-1.fc41.x86_64
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-draw-1:24.8.5.2-1.fc41.x86_64
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-calc-1:24.8.5.2-1.fc41.x86_64
        libreoffice-data = 1:24.8.5.2-1.fc41 is needed by (installed) libreoffice-base-1:24.8.5.2-1.fc41.x86_64
$ 

Perhaps if I can pass all the package names to the “rpm --erase” command it would be easier than doing it one by one for 22 packages.

I’ll experiment to see if I can pass a list of package names to “rpm --erase”

Yes, that is what you would have to do. If you can make a command that generates the list you want, then an easy way to pass that to rpm is with the xargs command. For example: rpm -qa | grep '^libreoffice-' | xargs rpm -ve. You might want to test it with just rpm -qa | grep '^libreoffice-' | xargs first, which will just echo the package names.

If the issue persists, check the output:

sudo dnf remove libreoffice-\*
sudo dnf rq libreoffice\* --installed

Note that the hyphen and escaping globs are important.

1 Like

He is saying “dnf” doesn’t see the packages. Only rpm.