Hi,
I’ve just installed F41 Workstation edition and after a few hours I’m unable to use the “sudo dnf” command in the terminal.
It was working right after the install so, I think something went wrong with an update.
Is there a way to fix that?
Hi,
I’ve just installed F41 Workstation edition and after a few hours I’m unable to use the “sudo dnf” command in the terminal.
It was working right after the install so, I think something went wrong with an update.
Is there a way to fix that?
Can you check if the program is still physically on the drive?
$ which dnf
/usr/bin/dnf
$ rpm -qi dnf5
Name : dnf5
Version : 5.2.8.1
Release : 2.fc41
Architecture: x86_64
[etc...]
It doesn’t seems to be installed anymore…
$ which dnf
/usr/bin/which: no dnf in (/home/admin/.local/bin:/home/admin/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)
$ rpm -qi dnf5
package dnf5 is not installed
(tried also with dnf3, just in case)
It should be pretty easy to reinstall it, on my PC I have Fedora 41 and this command shows the URL to the package:
dnf download --url --resolve dnf5.x86_64
Updating and loading repositories:
Repositories loaded.
http://mirror.math.princeton.edu/pub/fedora/linux/updates/41/Everything/x86_64/Packages/d/dnf5-5.2.8.1-2.fc41.x86_64.rpm
Since your dnf is gone and you obviously can’t use dnf to install it then, you can use “rpm” command in network URL mode:
sudo rpm -i http://mirror.math.princeton.edu/pub/fedora/linux/updates/41/Everything/x86_64/Packages/d/dnf5-5.2.8.1-2.fc41.x86_64.rpm
Then immediately do some dnf commands like:
sudo dnf upgrade
and confirm it’s working
I tried but I have missing dependencies as well:
$ sudo rpm -i http://mirror.math.princeton.edu/pub/fedora/linux/updates/41/Everything/x86_64/Packages/d/dnf5-5.2.8.1-2.fc41.x86_64.rpm
error: Failed dependencies:
libdnf5-cli(x86-64) = 5.2.8.1-2.fc41 is needed by dnf5-5.2.8.1-2.fc41.x86_64
libdnf5-cli.so.2()(64bit) is needed by dnf5-5.2.8.1-2.fc41.x86_64
libsdbus-c++.so.1()(64bit) is needed by dnf5-5.2.8.1-2.fc41.x86_64
I can’t find a way to install these without using “dnf”. I tried to use “rpm” but then I get the same issue:
$ sudo rpm -i https://dl.fedoraproject.org/pub/fedora/linux/updates/41/Everything/x86_64/Packages/p/perl-libdnf5-cli-5.2.8.1-2.fc41.x86_64.rpm
error: Failed dependencies:
libdnf5-cli(x86-64) = 5.2.8.1-2.fc41 is needed by perl-libdnf5-cli-5.2.8.1-2.fc41.x86_64
libdnf5-cli.so.2()(64bit) is needed by perl-libdnf5-cli-5.2.8.1-2.fc41.x86_64
Did you try with dnf4
by any chance? It should be available on F41.
dnf4 --version
4.22.0
Installed: rpm-0:4.20.0-1.fc41.x86_64 at Sat 12 Oct 2024 04:31:16 PM GMT
Built : Fedora Project at Tue 08 Oct 2024 03:18:49 PM GMT
If available, you can use it to reinstall dnf5
.
Yes same thing. It’s not available
One of the update litterally removed the entire ‘dnf’ functionnality and its dependencies.
I can’t find a way to install these without using “dnf”. I tried to use “rpm” but then I get the same issue
You keep adding packages to the “rpm -i …” until it works
I can run this on my system which “works” because my dnf5 is okay
dnf download --resolve --alldeps --url dnf5.x86_64 | grep dnf
which shows three packages–> dnf5 libdnf5 libdnf5-cli
http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/d/dnf5-5.2.8.1-2.fc41.x86_64.rpm
http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/l/libdnf5-5.2.8.1-2.fc41.x86_64.rpm
http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/l/libdnf5-cli-5.2.8.1-2.fc41.x86_64.rpm
The true resolved deps for dnf5 is huge (~ 115 packages) but I’m going to assume here that only the direct packages for dnf5 got removed (that have “dnf” in the name). So I got those three rpms above by doing a resolve on all “alldeps” for dnf5 so it doesn’t skip the ones on my local system and filtered to “dnf”.
so try the rpm command for all three rpms
sudo rpm -i http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/d/dnf5-5.2.8.1-2.fc41.x86_64.rpm http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/l/libdnf5-5.2.8.1-2.fc41.x86_64.rpm http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/l/libdnf5-cli-5.2.8.1-2.fc41.x86_64.rpm```
Might also be interesting to see if the dnf logs are still there, to find out what triggered the removal:
$ ls -la /var/log/dnf*
One more seems to be missing:
error: Failed dependencies:
libsdbus-c++.so.1()(64bit) is needed by dnf5-5.2.8.1-2.fc41.x86_64
But I can’t find it in Packages folder you used for the other.
Which one should have the information?
-rw-r--r--. 1 root root 463037 Dec 28 13:18 /var/log/dnf5.log
-rw-r--r--. 1 root root 1048547 Dec 28 13:14 /var/log/dnf5.log.1
-rw-r--r--. 1 root root 1048482 Dec 28 12:56 /var/log/dnf5.log.2
-rw-r--r--. 1 root root 668 Dec 29 08:27 /var/log/dnf.librepo.log
-rw-r--r--. 1 root root 9275 Dec 29 08:27 /var/log/dnf.log
-rw-r--r--. 1 root root 232 Dec 29 08:27 /var/log/dnf.rpm.log
That library is in a package of a different name, I found it with --whatprovides
dnf5 repoquery --whatprovides=\*/libsdbus-c++.so.1
sdbus-cpp-0:1.5.0-3.fc41.x86_64
So it looks like you didn’t simply remove two or three rpms but a bunch.
The URL to that is
http://ziply.mm.fcix.net/fedora/linux/releases/41/Everything/x86_64/os/Packages/s/sdbus-cpp-1.5.0-3.fc41.x86_64.rpm
If you want to try for four URLs.
sudo rpm -i \
http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/d/dnf5-5.2.8.1-2.fc41.x86_64.rpm \
http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/l/libdnf5-5.2.8.1-2.fc41.x86_64.rpm \
http://ziply.mm.fcix.net/fedora/linux/updates/41/Everything/x86_64/Packages/l/libdnf5-cli-5.2.8.1-2.fc41.x86_64.rpm \
http://ziply.mm.fcix.net/fedora/linux/releases/41/Everything/x86_64/os/Packages/s/sdbus-cpp-1.5.0-3.fc41.x86_64.rpm
But I’d look in /var/log/dnf5.log for lines with “uninstall” in them that were removing those dnf packages. I removed a package I don’t need called “qt5-qttools” just to see what the dnf5.log logging looks like and found it was:
grep qt5-qttools dnf5*log
2024-12-29T17:22:23+0000 [22486] INFO — DNF5 launched with arguments: “dnf5 rm qt5-qttools” —
2024-12-29T17:22:26+0000 [22486] INFO RPM callback uninstall start “qt5-qttools-0:5.15.15-1.fc41.x86_64” total 12
2024-12-29T17:22:26+0000 [22486] INFO RPM callback uninstall stop “qt5-qttools-0:5.15.15-1.fc41.x86_64” amount 12 total 12
So seeing “uninstall” seems to point to removing packages.
If you want to see the full Requires list for “dnf5” package, that is:
rpm -qR dnf5
/bin/sh
/bin/sh
/bin/sh
coreutils
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.32)(64bit)
libc.so.6(GLIBC_2.34)(64bit)
libc.so.6(GLIBC_2.38)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_ABI_DT_RELR)(64bit)
libdnf5(x86-64) = 5.2.8.1-2.fc41
libdnf5-cli(x86-64) = 5.2.8.1-2.fc41
libdnf5-cli.so.2()(64bit)
libdnf5.so.2()(64bit)
libfmt.so.11()(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libgcc_s.so.1(GCC_3.3.1)(64bit)
librpm.so.10()(64bit)
libsdbus-c++.so.1()(64bit)
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libstdc++.so.6(CXXABI_1.3.13)(64bit)
libstdc++.so.6(CXXABI_1.3.15)(64bit)
libstdc++.so.6(CXXABI_1.3.2)(64bit)
libstdc++.so.6(CXXABI_1.3.3)(64bit)
libstdc++.so.6(CXXABI_1.3.5)(64bit)
libstdc++.so.6(CXXABI_1.3.9)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libstdc++.so.6(GLIBCXX_3.4.11)(64bit)
libstdc++.so.6(GLIBCXX_3.4.14)(64bit)
libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
libstdc++.so.6(GLIBCXX_3.4.18)(64bit)
libstdc++.so.6(GLIBCXX_3.4.19)(64bit)
libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
libstdc++.so.6(GLIBCXX_3.4.22)(64bit)
libstdc++.so.6(GLIBCXX_3.4.26)(64bit)
libstdc++.so.6(GLIBCXX_3.4.29)(64bit)
libstdc++.so.6(GLIBCXX_3.4.30)(64bit)
libstdc++.so.6(GLIBCXX_3.4.32)(64bit)
libstdc++.so.6(GLIBCXX_3.4.9)(64bit)
libsystemd.so.0()(64bit)
libsystemd.so.0(LIBSYSTEMD_209)(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
rpmlib(RichDependencies) <= 4.12.0-1
rtld(GNU_HASH)
is pkcon still available?
/usr/bin/pkcon install dnf5
Doesn’t pkcon underneath call to dnf (both of dnf4 or 5 he doesn’t have) so that wouldn’t help him?
Mine says:
pkcon backend-details
Name: dnf
Description: Dnf
Author: Richard Hughes <richard@hughsie.com>
@grumpey Thanks a lot! I ran
sudo pkcon install dnf5
and it fixed everything and I am now able to use dnf again (version 5.2.8.1).
@marko3209
I check the log and couldn’t find any “uninstall” in it. So, still no clue what could have caused the issue…
dnf5 log is so verbose that the junk rotates into older logs quickly, so it might be in dnf5.log.4 or something. If you want to check try
grep uninstall dnf5.log* | grep dnf