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.
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.
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)
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.
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?
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.
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:
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:
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.