Unable to upgrade Fedora from 41 to any version. RTC on my motherboard doesn't work

Hi,

I’ve been stuck on Fedora 41 for a but too long and finally had the time to dig into what’s going wrong with it. I’ve tried an incremental upgrade to 42, an upgrade to 43, and an upgrade to 44 by updating the GPG key.

All fail after reboot and revert back to 41.

This has all been in the teminal with the DNF system plugin using this guide:

output of the plugins logs using dnf system-upgrade log reveals this:
https://paste.centos.org/view/e4b6ed23

type or paste code here
and output of cat /var/log/dnf5.log | grep ERROR reveals this:

2025-06-27T00:00:07+0000 [1061] ERROR [rpm] Verifying a signature using certificate 466CF2D8B60BC3057AA9453ED0622462E99D6AD1 (Fedora (41) <fedora-41-primary@fedoraproject.org>):
2025-06-27T00:00:07+0000 [1061] ERROR [rpm] rpmdbNextIterator: skipping h#   37507 
2025-06-27T00:00:07+0000 [1061] ERROR [rpm] Verifying a signature using certificate 466CF2D8B60BC3057AA9453ED0622462E99D6AD1 (Fedora (41) <fedora-41-primary@fedoraproject.org>):
2025-06-27T00:00:07+0000 [1061] ERROR [rpm] rpmdbNextIterator: skipping h#   37512 
2025-06-27T00:00:12+0000 [1061] ERROR [rpm] Verifying a signature using certificate B0F4950458F69E1150C6C5EDC8AC4916105EF944 (Fedora (42) <fedora-42-primary@fedoraproject.org>):
2025-06-27T00:00:12+0000 [1061] ERROR [rpm] /usr/lib/sysimage/libdnf5/offline/./packages/kernel-devel-6.19.14-108.fc42.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 105ef944: BAD
2025-06-27T00:00:12+0000 [1061] ERROR Command returned error: Failed to read package header from file "/usr/lib/sysimage/libdnf5/offline/./packages/kernel-devel-6.19.14-108.fc42.x86_64.rpm"

Notably the RTC on my motherboard does not work in the BIOS version that works with the rest of my hardware. I have a custom systemd service to jump chrony to the correct time when waking from sleep.

I am unsure of the best way to work around this when doing a system update or if there’s a better more permanent way of working around my clock issues.

Thanks in advance,

-Maeve

Here’s an alternative upgrade method:

sudo dnf distro-sync --releasever=42

This is best to run in a text TTY.

See also: Failed partial upgrade from 43 to 44 leaves system confused - #2 by vgaetera

If you don’t mind: what service would that be?

Assuming the issue is the system time it too far in the past and that is breaking the signature check.

You can try touch /usr/lib/clock-epoch.
Systemd should use the time on that file if the rtc returns an earlier time.

This had been necessary when upgrading raspberry pi systems that lack an RTC.

Let us know if this works.

so mine is a custom service I made and it lives at /etc/systemd/system/sync_time.service

it looks like this now:

[Unit]
Description=Sync RTC after wake from suspend because firmware updates to the MOBO are a HOE!!!
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target


[Service]
Type=simple
ExecStart=/bin/chronyc -a makestep
User=root
#Environment=DISPLAY=:0

[Install]
WantedBy=sleep.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target system-update-pre.target

systemd-timesyncd does the same thing I believe.

No dice but then again I’m sure it would’ve helped to enable and restart the edited service… -_-

also had no idea about timesyncd. All these years of badly combing man pages and forums when all I had to do was ask…

Here’s a method that relies on /var/lib/systemd/timesync/clock:
systemd-timesyncd.service: Network Time Synchronization | Man Page | System Administration | systemd-udev | ManKier

sudo systemctl mask chronyd.service --now
sudo systemctl enable systemd-timesyncd.service --now

I’m not super clear on how to implement this. I’m assuming I have to do this as a systemd service so it happens at boot before the rest of the upgrade proceeds???

Still no dice.

tried the following /etc/systemd/system/clock-touch-upgrade.service with systemd:

[Unit]
Description=Clock fix for upgrading beacause RTC is dead
Before=dnf5-offline-transaction.service

[Service]
Type=simple
ExecStart=touch /usr/lib/clock-epoch
User=root
#Environment=DISPLAY=:0

[Install]
WantedBy=system-update-pre.target

Errors in /var/log/dnf5.log are still:

2025-06-27T00:00:07+0000 [1063] ERROR [rpm] Verifying a signature using certificate 466CF2D8B60BC3057AA9453ED0622462E99D6AD1 (Fedora (41) <fedora-41-primary@fedoraproject.org>):
2025-06-27T00:00:07+0000 [1063] ERROR [rpm] rpmdbNextIterator: skipping h#   37507 
2025-06-27T00:00:07+0000 [1063] ERROR [rpm] Verifying a signature using certificate 466CF2D8B60BC3057AA9453ED0622462E99D6AD1 (Fedora (41) <fedora-41-primary@fedoraproject.org>):
2025-06-27T00:00:07+0000 [1063] ERROR [rpm] rpmdbNextIterator: skipping h#   37512 
2025-06-27T00:00:12+0000 [1063] ERROR [rpm] Verifying a signature using certificate B0F4950458F69E1150C6C5EDC8AC4916105EF944 (Fedora (42) <fedora-42-primary@fedoraproject.org>):
2025-06-27T00:00:12+0000 [1063] ERROR [rpm] /usr/lib/sysimage/libdnf5/offline/./packages/kernel-devel-6.19.14-108.fc42.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 105ef944: BAD
2025-06-27T00:00:12+0000 [1063] ERROR Command returned error: Failed to read package header from file "/usr/lib/sysimage/libdnf5/offline/./packages/kernel-devel-6.19.14-108.fc42.x86_64.rpm"

I’ve combed through the logs from … and here are some things I’ve found:

Jun 26 20:00:07 Lucia dnf-3[1062]: another upgrade tool is running. exiting quietly.
Jun 26 20:00:07 Lucia systemd[1]: dnf-system-upgrade.service: Deactivated successfully.
Jun 26 20:00:07 Lucia systemd[1]: Finished dnf-system-upgrade.service - System Upgrade using DNF.
Jun 26 20:00:08 Lucia dnf5[1063]: Starting system upgrade. This will take a while.
Jun 26 20:00:11 Lucia kernel: kauditd_printk_skb: 57 callbacks suppressed
Jun 26 20:00:12 Lucia dnf5[1063]: Package                                                    Arch   Versi>
Jun 26 20:00:12 Lucia dnf5[1063]: Removing:
Jun 26 20:00:12 Lucia dnf5[1063]:  kernel                                                    x86_64 6.17.>
Jun 26 20:00:12 Lucia dnf5[1063]:  kernel-core                                               x86_64 6.17.>
Jun 26 20:00:12 Lucia dnf5[1063]:  kernel-devel                                              x86_64 6.17.>
Jun 26 20:00:12 Lucia dnf5[1063]:  kernel-modules                                            x86_64 6.17.>
Jun 26 20:00:12 Lucia dnf5[1063]:  kernel-modules-core                                       x86_64 6.17.>
Jun 26 20:00:12 Lucia dnf5[1063]:  kernel-modules-extra                                      x86_64 6.17.>
...
Jun 26 20:00:12 Lucia dnf5[1063]:  libnl3                                                    x86_64 3.11.>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libnl3                                        x86_64 3.11.>
Jun 26 20:00:12 Lucia dnf5[1063]:  libnl3-cli                                                x86_64 3.11.>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libnl3-cli                                    x86_64 3.11.>
Jun 26 20:00:12 Lucia dnf5[1063]:  libnma                                                    x86_64 1.10.>
Jun 26 20:00:12 Lucia audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dnf5-offline-transaction comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jun 26 20:00:12 Lucia systemd[1]: dnf5-offline-transaction.service: Main process exited, code=exited, status=1/FAILURE
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libnma                                        x86_64 1.10.>
Jun 26 20:00:12 Lucia dnf5[1063]:  libnma-gtk4                                               x86_64 1.10.>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libnma-gtk4                                   x86_64 1.10.>
Jun 26 20:00:12 Lucia dnf5[1063]:  libnotify                                                 x86_64 0.8.8>
...
un 26 20:00:12 Lucia dnf5[1063]:  libnumbertext                                             x86_64 1.0.1>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libnumbertext                                 x86_64 1.0.1>
Jun 26 20:00:12 Lucia dnf5[1063]:  libnvme                                                   x86_64 1.15->
Jun 26 20:00:12 Lucia kernel: audit: type=1130 audit(1750982412.736:70): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=dnf5-offline-transaction comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jun 26 20:00:12 Lucia systemd[1]: dnf5-offline-transaction.service: Failed with result 'exit-code'.
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libnvme                                       x86_64 1.10->
Jun 26 20:00:12 Lucia dnf5[1063]:  liboauth                                                  x86_64 1.0.3>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing liboauth                                      x86_64 1.0.3>
Jun 26 20:00:12 Lucia dnf5[1063]:  libodfgen                                                 x86_64 0.1.8>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libodfgen                                     x86_64 0.1.8>
Jun 26 20:00:12 Lucia dnf5[1063]:  liboeffis                                                 x86_64 1.4.1>
Jun 26 20:00:12 Lucia dnf5[1063]:  libogg                                                    i686   2:1.3>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libogg                                        i686   2:1.3>
Jun 26 20:00:12 Lucia dnf5[1063]:  libogg                                                    x86_64 2:1.3>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libogg                                        x86_64 2:1.3>
Jun 26 20:00:12 Lucia dnf5[1063]:  libopenjph                                                x86_64 0.21.>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libopenjph                                    x86_64 0.21.>
Jun 26 20:00:12 Lucia dnf5[1063]:  libopenmpt                                                x86_64 0.8.6>
Jun 26 20:00:12 Lucia systemd[1]: Failed to start dnf5-offline-transaction.service - Offline upgrades/transactions using DNF 5.
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libopenmpt                                    x86_64 0.8.3>
Jun 26 20:00:12 Lucia dnf5[1063]:  libopusenc                                                x86_64 0.2.1>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing libopusenc                                    x86_64 0.2.1>
Jun 26 20:00:12 Lucia dnf5[1063]:  liborc2                                                   x86_64 2.0.7>
Jun 26 20:00:12 Lucia dnf5[1063]:    replacing liborc2                                       x86_64 2.0.6>
Jun 26 20:00:12 Lucia dnf5[1063]:  liborcus                                                  x86_64 0.20.>
...
Jun 26 20:00:15 Lucia dnf5[1063]: Upgrading groups:
Jun 26 20:00:15 Lucia dnf5[1063]:  Virtualization
Jun 26 20:00:15 Lucia dnf5[1063]:  Sound and Video
Jun 26 20:00:15 Lucia dnf5[1063]:  Design Suite
Jun 26 20:00:15 Lucia dnf5[1063]:  Anaconda tools
Jun 26 20:00:15 Lucia dnf5[1063]: Upgrading groups:
Jun 26 20:00:15 Lucia dnf5[1063]:  Fedora Workstation product core
Jun 26 20:00:15 Lucia dnf5[1063]:  Standard
Jun 26 20:00:15 Lucia dnf5[1063]:  Printing Support
Jun 26 20:00:15 Lucia dnf5[1063]:  Common NetworkManager Submodules
Jun 26 20:00:15 Lucia dnf5[1063]:  Multimedia
Jun 26 20:00:15 Lucia dnf5[1063]:  LibreOffice
Jun 26 20:00:15 Lucia dnf5[1063]:  Input Methods
Jun 26 20:00:15 Lucia dnf5[1063]:  Hardware Support
Jun 26 20:00:15 Lucia dnf5[1063]:  Guest Desktop Agents
Jun 26 20:00:15 Lucia dnf5[1063]:  GNOME
Jun 26 20:00:15 Lucia dnf5[1063]:  Fonts
Jun 26 20:00:15 Lucia dnf5[1063]:  Firefox Web Browser
Jun 26 20:00:15 Lucia dnf5[1063]:  Dial-up Networking Support
Jun 26 20:00:15 Lucia dnf5[1063]:  Desktop accessibility
Jun 26 20:00:15 Lucia dnf5[1063]:  Core
Jun 26 20:00:15 Lucia dnf5[1063]:  Container Management
Jun 26 20:00:15 Lucia dnf5[1063]:  base-x
Jun 26 20:00:15 Lucia dnf5[1063]:  base-graphical
Jun 26 20:00:15 Lucia dnf5[1063]: Upgrading environmental groups:
Jun 26 20:00:15 Lucia dnf5[1063]:  Cinnamon Desktop
Jun 26 20:00:15 Lucia dnf5[1063]:  Fedora Workstation
Jun 26 20:00:15 Lucia dnf5[1063]: Transaction Summary:
Jun 26 20:00:15 Lucia dnf5[1063]:  Installing:        96 packages
Jun 26 20:00:15 Lucia dnf5[1063]:  Upgrading:       3469 packages
Jun 26 20:00:15 Lucia dnf5[1063]:  Replacing:       3487 packages
Jun 26 20:00:15 Lucia dnf5[1063]:  Removing:           9 packages
Jun 26 20:00:15 Lucia dnf5[1063]:  Downgrading:        5 packages
Jun 26 20:00:15 Lucia dnf5[1063]: Failed to read package header from file "/usr/lib/sysimage/libdnf5/offline/./packages/kernel-devel-6.19.14-108.fc42.x86_64.rpm
Jun 26 20:00:15 Lucia systemd-journald[741]: Journal stopped

Have you cleared the downloaded cache and pulled it all again?

tried it previously with dnf5 offline clean unless you’ve got a more robust way of cleaning things out?

Nope - that’s what I’d use. It’s just files on disk so you could actively empty /usr/lib/sysimage/libdnf5/offline but the net result would be the same.

How about upgrading from 41 to 43, and skipping 42 out.

I’d tried that previously to similar effect. I think I needed an --allowerasing tag due to some conflicts. I’m giving the distro-sync method Vladislav had mentioned a try

So i did this and on reboot fedora 42 did not appear in GRUB and booting with the previous entry gave me an error screen

went into tty but couldn’t repair grub.

Decided F**kit and pushed forward with a distro-sync to fedora 43 and that somehow worked.

Check out this part of man systemd.special

   sleep.target
       A special target unit that is pulled in by suspend.target, hibernate.target, suspend-then-hibernate.target, and
       hybrid-sleep.target and may be used to hook units into the sleep state logic.

       In order to hook external programs before the actual system sleep operation, place their command line in a service
       unit file's ExecStart= line (use Type=oneshot), and ensure the unit is pulled in by sleep.target and ordered before
       it. In order to hook program code after the actual system sleep operation (i.e. to be run after the system woke up
       again), place the command in ExecStop= instead, and make sure to enable StopWhenUnneeded= and RemainAfterExit=. Both
       approaches can be combined into one unit file in order to run programs both before and after the sleep operation.
          Example 1. Combined Example

               [Unit]
               DefaultDependencies=no
               StopWhenUnneeded=yes
               Before=sleep.target

               [Service]
               Type=oneshot
               RemainAfterExit=yes
               ExecStart=/usr/bin/some-before-command
               ExecStop=/usr/bin/some-after-command

               [Install]
               WantedBy=sleep.target

At a terminal you would run the command.

sudo touch /usr/lib/clock-epoch

I only do this before a system-upgrade on my raspberry pi.
As a normal boot will start chronyd abd set the time from the network.
But setting the ti e using chrony does not happen when doing a system-upgrade.

This is a good reason to switch to systemd-timesyncd that activates before offline upgrade and has it’s own automatic timestamp to deal with incorrect RTC.

There can be good reasons to switch to sd-typesyncd, but this is not one of them.

The file /usr/lib/clock-epoch is read by systemd itself according to man systemd

SYSTEM CLOCK EPOCH
When systemd is started or restarted, it may set the system clock to the
“epoch”. This mechanism is used to ensure that the system clock remains
somewhat reasonably initialized and roughly monotonic across reboots, in
case no battery-backed local RTC is available or it does not work
correctly.

Automation helps avoid human errors and this way it should just work for any future offline upgrades with minimal footprint and without the need to reinvent the wheel.