How to perform offline updates during shutdown KDE spin

I have Fedora 35 KDE spin installed, KDE Plasma version 5.23.5.
I want to set offline updates to apply during shutdown instead of startup. How can I do that? I couldn’t find an option in the settings.

1 Like

This option is present in the settings >system update and there is check box and apply

The only relevant option I found is in the “Software update” tab. It has offline updates that apply on restart. I want the updates to apply on shutdown instead of restart.

Okey then make it online so it will update when device is on and and kernel update will be done when you turn on pc. because it is not possible in kde as far as i know if you think it is required then kindly post a featyre request at bugs
https://bugs.kde.org/
If it is accepted you will get that feature in ned update.

We need to clarify the “apply to restart” a bit: the system restarts in a special reduced boot for the upgrade, and then restarts again for you to use. It doesn’t restart, apply updates, and allow you to use it in the same boot. The “offline” bit means that you cannot use your system while it’s updating. It’s a whole different boot (At least that’s how the updates with gnome-software and dnf system-upgrade work, I expect that’s the same with KDE)

If you want to upgrade your system and then restart it, simply close all your applications and then in a terminal go:

sudo dnf update -y && sudo reboot

It isn’t technically updating “during shutdown”. It updates, and then reboots.

Is it possible to let the system download the offline update, then during shutdown trigger a systemd service that forces the update somehow?

Well, it’s probably possible, but how one would go about doing this and how much more work it would take to implement in different tools is a different question. It is not currently part of the upgrade design, so I can’t see a way of doing it without a bit of manual work on your:

Download the update (as a cronjob or something if you want)

sudo dnf update --refresh --downloadonly

then when you want to reboot run your upgrade, the -C flag will make dnf only use the cache which you prepared before:

sudo dnf update -C -y && sudo reboot

Can you clarify what the issue with the current system is? You can either update online—while you are using your computer—or offline where a special boot is required. What you are asking is a little bit of both—not online, but not during a special boot. What you want is not so simple—because you want the system to “partially shut down” to reach a state similar to the special update boot and I don’t think that’s trivial to do because of the variety of system configurations out there that need to be supported. (if you’re trying to replicate how windows does things, remember that windows gives you very little choice to customise system services etc., so they can create tools and test them with their limited use cases)

There are 2 issues with offline updates:
1- I don’t like to wait a couple minutes instead of seconds for my computer to start.
2- Sometimes I restart but nothing happens, and I need to download the update again (I suspect that this happens when I install something using dnf)

I think a way to do this is by caching the update in a non standard location so any dnf transaction would not wipe it.
I’m not trying to replicate windows, I read somewhere that on GNOME update and shutdown is possible so why not on Plasma? Isn’t this operation DE independant?

Hrm, but if you update on shutdown, that’ll mean it’ll take a couple of minutes to shutdown, no? The overall time won’t reduce unless you don’t use offline updates at all and update while you work using dnf?

This is probably because of the disconnect between dnf and the the software GUI which uses packagekit. dnf and packagekit do not share state or caches, so depending on what was most recently used, the other’s state may be outdated. So, for example, if you used dnf to install a package and some other packages got updated in that transaction, until packagekit refreshes it’s state again, it will be outdated.

There’s no real workaround for this—just try and not mix the two (I know that’s hard because the GUI tools cannot be used to install all packages).

Well you can stop the dnf cache from being wiped completely. Check the keepcache option in man dnf.conf. However, this is for dnf, not for packagekit. dnf has it’s own offline-update plugin which does the same thing as the GUIs: downloads updates, on reboot boots into a special reduced environment, completes update, and reboots for the user.

Can you provide a link to this source please? I’ve not yet seen “update on shutdown” anywhere, and a search didn’t show me anything. From what I know, the only update mechanism is to reboot into a reduced boot environment and then reboot again for the user when finished.

I found this ticket here, and as you can see from the discussion, Gnome-Software cannot currently update on shutdown, and you’ll also see that it is not straightforward to implement:

https://pagure.io/fedora-workstation/issue/258

There it is:

About the waiting time: The time it takes during shutdown doesn’t matter to me much. I normally shutdown when I’m done using the computer. But I turn it on when I need it.

I’m not sure about that. I always thought that updates happen on reboot in a special boot, and the thread I linked to suggests that “update on shutdown” has not been implemented.

So, for the time being until it is implemented, you’ll need to use the dnf method to update on shutdown.

I think I will just use normal online updates and revert to a previous snapshot if anything breaks.

1 Like