Dnf system-upgrade f38 to f39 (Workstation) attempts to use dnf5 and fails

I have an external USB drive with Fedora Workstation 38. I attempted to upgrade from f38 to f39, following Upgrading Fedora Offline. This has worked until recently, but it failed today at the finaldoas dnf system-upgrade download --releasever=39 --best --allowerasing step:

% journalctl -b -3 -g dnf5 --no-hostname |cat
Mar 21 20:25:12 systemd[1]: Starting dnf5-offline-transaction.service - Offline upgrades/transactions using DNF 5...
Mar 21 20:25:13 dnf5[784]: Error reading state: Error reading offline state file.: (2) - No such file or directory [/usr/lib/sysimage/libdnf5/offline/offline-transaction-state.toml]. Rerun the command you used to initiate the offline transaction, e.g. `dnf5 system-upgrade download [OPTIONS]`.
Mar 21 20:25:13 systemd[1]: dnf5-offline-transaction.service: Main process exited, code=exited, status=1/FAILURE
Mar 21 20:25:13 systemd[1]: dnf5-offline-transaction.service: Failed with result 'exit-code'.
Mar 21 20:25:13 systemd[1]: Failed to start dnf5-offline-transaction.service - Offline upgrades/transactions using DNF 5.
Mar 21 20:25:13 systemd[1]: dnf5-offline-transaction.service: Triggering OnFailure= dependencies.
Mar 21 20:25:13 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dnf5-offline-transaction comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Mar 21 20:25:13 systemd[1]: Starting dnf5-offline-transaction-cleanup.service - Offline upgrade/transaction using DNF 5 failed...
Mar 21 20:25:13 systemd[1]: dnf5-offline-transaction-cleanup.service: Deactivated successfully.
Mar 21 20:25:13 systemd[1]: Finished dnf5-offline-transaction-cleanup.service - Offline upgrade/transaction using DNF 5 failed.
Mar 21 20:25:13 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dnf5-offline-transaction-cleanup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 21 20:25:13 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dnf5-offline-transaction-cleanup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Is that possibly an artifact of doas?
What happens if you use sudo instead?

I have yet to see dnf5 interjected into any of my dnf commands.

What is the output of ls -l /usr/bin/dnf*?
On my fedora 39 system I see this.

$ ls -l /usr/bin/dnf*
lrwxrwxrwx. 1 root root    5 Feb 19 18:00 /usr/bin/dnf -> dnf-3
-rwxr-xr-x. 1 root root 2092 Feb 19 18:00 /usr/bin/dnf-3
lrwxrwxrwx. 1 root root    5 Feb 19 18:00 /usr/bin/dnf4 -> dnf-3

I don’t think dnf5 is even installed on either f38 or f39 unless the user has chosen to do so.

I see exactly the same on my VM I have upgraded to f40.

It looks like dnf5 didn’t implement the systemd offline update protocol correctly, specifically:

  1. As the first step, an update service should check if the /system-update or /etc/system-update symlink points to the location used by that update service. In case it does not exist or points to a different location, the service must exit without error. It is possible for multiple update services to be installed, and for multiple update services to be launched in parallel, and only the one that corresponds to the tool that created the symlink before reboot should perform any actions. It is unsafe to run multiple updates in parallel.

Please open an issue for this: Issues · rpm-software-management/dnf5 · GitHub

Edit: dnf5-offline-transaction.service appears to have only been merged three days ago. How do you have it already on F38? Do you have a development version installed?

It was planed for F39, and if someone upgraded to some early prerelease of F39, dnf4 would have been replaced by dnf5.

% ls -l /usr/bin/dnf*                                  
lrwxrwxrwx. 1 root root       5 Feb 19 20:00 /usr/bin/dnf -> dnf-3*
-rwxr-xr-x. 1 root root    2092 Feb 19 20:00 /usr/bin/dnf-3*
lrwxrwxrwx. 1 root root       5 Feb 19 20:00 /usr/bin/dnf4 -> dnf-3*
-rwxr-xr-x. 1 root root 1596544 Mar 19 21:00 /usr/bin/dnf5*

I installed dnf5 last year (using dnf5-unstable) to look at differences from dnf3 (some options I use were missing at the time). I removed dnf5 and the dnf5-unstable repo to see if the update will go thru without it.

Edit: after removing dnf5, the update went smoothly.

1 Like

This will be fixed by this upstream PR for DNF 5: system-upgrade: bugfixes, output changes by evan-goode · Pull Request #1334 · rpm-software-management/dnf5 · GitHub.

1 Like