Why do I need reboot with update through Discover, but not through sudo dnf update?

Update through Discover I have to reboot as long as there’s a system update included.

Update through CLI (sudo dnf update) I don’t have to reboot.

What’s the difference, technically, behind the scenes?

dnf defaults to performing online updates, whereas I presume Discover defaults to offline.

You can always perform an offline update with dnf, with sudo dnf update --refresh --offline

You can follow that up with: dnf needs-restarting
This will check if any of the packages that have been updated require a reboot(restart).

Or all of this: Key usage options include:

  • dnf needs-restarting -r: Reports if a reboot is required (exit code 1) or not (exit code 0) based on core library updates.

  • dnf needs-restarting -s: Lists specific systemd services that need restarting.

  • dnf needs-restarting -u: Lists only processes belonging to the current user.
    eg:

 dnf4 needs-restarting -r
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.

Oh okay, so I actually need to reboot with CLI/dnf as well I just don’t get prompted without that command.

Thanks everyone, that makes sense.

i have found that discover sometimes exaggerates when talking about restarting, sometimes will ask for a restart when updating libreoffice and some obscure libraries i didnt even knew i had, sometimes wont ask me to restart with other packages

i personally, being told or not, i do restart pc if kde does a big update or kernel is updated, otherwise, it can wait the restart, system will not crumble for a couple days

When you update using DIscover, the updates doesn’t actually occur until you select to reboot and update.

You can also use tracer after updating. This will tell you what programs need to be restarted. It will also tell you if you need to log out and back in, or reboot.

Discover defaults to installing updates offline (requiring a reboot) because it is the safest method as it makes sure nothing outdated is running on your system after the update, even though newer packages have been installed. Especially important when there is a kernel update as you will remain on the old kernel until rebooting despite installing a new one. If you go to System Settings → Software Updates, it is in fact possible to turn off reboots for updates via Discord as well. In that case, or when updating via dnf without using --offline, you should ideally have some experience so you can assess yourself if any of the updated packages require further action. As was suggested above tracer is also a good tool.

When updating without a reboot you PROBABLY won’t run into any problems and can keep using the system for the time being even though some software currently running might remain outdated, it will just move to the new version when you next decide to reboot. However personally I have run into an issue a few times where an on-the-fly update of packages disrupted something that was currently running so I recommend offline updater unless for some reason you really need to update but can’t afford to reboot right now or you check for updates and it only includes some packages you are able to assess will not cause any problems when updated immediately.

when you use dnf, the kernel will not be updated until you reboot, same thing when things are important, i know i am oversimplifying things, generalizing but we are on kde, and dnf is not that popular, and in the end, for end users, this is what we see