How to set up Systemd Offline Updates with PackageKit?

Hi!

I wanted to use PackageKit’s support for systemd’s offline updates mechanism, to be able to install updates while the full system is not running, for stability purposes. It is also much more user friendly than running commands, especially for those folks who are coming from windows, and for those who were never really proficient in managing computers.
Since PackageKit talks with zypper, it shows changelogs, and as I understand PK’s zypper backend is prepared to not do dumb things (it even knows to update with "dup"on thumbleweed), theres nothing to lose, and everything to gain.

But, it does not seem to work. It just “fails” silently, without any system logs.
What can we do to put PackageKit’s offline updates functionality in working order?

In the rest of the post I’ll describe my findings.

I already replaced plasma5-pk-update with discover-notifier a few months ago, and so the update settings appeared in the KDE System Settings tool.

Currently it seems that KDE Discover is already able to prepare the updates, by talking to zypper to download all the updated packages.
/system-update is also created, it points to /var/lib/PackageKit/prepared-update, which contains the list of packages I requested to update.

But, despite that systemd then correctly starts the system for the system-update.target, that quickly ends, because there is no service defined to install the updates.
I was puzzled, what is exactly missing, and why? This works on AlmaLinux (and as I understand all Fedora-like systems) and Linux Mint without much manual setup.

I have digged up the internet, and according to PK’s documentation, an executable called /usr/libexec/pk-offline-update should be doing the update. On my Mint test system, this is executed by the packagekit-offline-update.service unit.

But I cannot find official packages for my Leap system that provides these files.
On Mint, they are provided by the main packagekit package, so I suppose they are intended to be part of the main package by the PK developers.

Beyond pk-offline-update and the service unit, I also wonder whether the necessary Plymouth components are there to show the install progress indication.

I have looked up earlier discussions about the packagekit topic. There the topic either did not go into offline updates, or it was suggested that everyone should roll their own update scripts.
But why should we roll our own, possibly faulty update scripts, if theres a solution published by packagekit devs, that is actually being maintained by people who already know the pitfalls?

Regarding “windows refugees”, I think making the update system more user friendly would pair well with the openSUSE Blog calls to action to switch to linux:

All the while those who dont like packagekit, or offline updates (because afaik PK can do “online” updates too), they can still do updates the old way.

I am not sure whether you are asking for help or it is just a rant. In the former case you need to start with step by step description of what you did so that others can also (try to) reproduce it.

And please, do not post pictures of textual information. That is what copy-paste is for.

Sorry, I did not intend it as a rant. I’m genuinely searching for a solution. In case thats why you thought so, I have bolded the question so that its easier to find on my wall of text, I did not intend that as shouting.

So basically I have a KDE based installation of Leap 15.6.
I have installed discover-notifier, which also resulted in its alternative, plasma5-pk-update being uninstalled automatically.

After that, the KDE System Settings app now has a “Software Update” menu at the bottom of the sidebar.

Opening this menu item I have ticked the box for “Use offline updates”. “Update software” is set to “Manually” for now.

Following these steps results in the KDE Discover app gaining a new “Update” menu at the bottom of its sidebar, where it will list updates that it has found through PackageKit (flatpak, firmware updates including UEFI dbx, and zypper updates).
This part works even today, but currently it does not always show all zypper updates, but often only Online Updates patches, so I think that would also be something worth looking into.

The problem starts when I have selected the “System upgrade” item on the “Update” menu’s list, and I click update, and when it finished I click the reboot button as the app requests. What I expect is that when the computer reboots, a dialog should appear with a progressbar that informs the user that updates are being installed. But instead of that, the system reboots very soon, and then boots as usual, and if I check, the updates havent been installed.

Thanks, but I have read that comment. Actually I wanted to refer to that post in mine, but it seems I botched the link and it does not load.

I see that you were recommending to use homemade update scripts, but thats what I wanted to address with this in my initial post:

The packagekit package already ships the necessary scripts and other things needed on other distributions, but not here. Why are those files stripped out in suse packages?

I have now read the german post with a translator, but I havent found the comment writing about why are offline updates disabled.

Furthermore, I think offline updates are not only disabled. They are currently not working, in my understanding because the necessary plumbing is missing: the specific packagekit executable that needs to be executed in system update mode, and the systemd service unit that would execute it at the right moment. Possibly more, for instance if the (plymouth based?) menu with the progress bar would also need files not currently present.

PackageKit is built without offline updates support in Leap 15. Offline updates are enabled in Leap 16 and Tumbleweed and most certainly work in Tumbleweed both with GNOME and KDE.

Oh, I see! So essentially thats a build config difference, and is going to change with Leap 16. That sounds good.

Is it perhaps possible to make it work on Leap 15.6?
Making the right systemd service unit file is the easier part, I’m more worried about what to do about the pk-offline-update executable, if I were to try it.