I think I have found the solution for automatic rpm-ostree updates!
Note that ublue fixes most of these points too, since quite a while, using their own updating service ublue-update. It uses topgrade which is an abstraction layer automatically updating everything it detects to support it (rpm-ostree, flatpak, distrobox, toolbox, …).
What is the problem?
“Traditional” Distros prompt users to update their stuff. This is annoying, unneeded and will lead to users not updating their system.
Meanwhile that may be needed, as “traditional” distros may have package conflicts and more, that need manual intervention.
Atomic Fedora doesnt need this, as it is just so much better.
But for some reason it has no automatic updates.
The updates are integrated in the software stores, great work @siosm but this integration has 2 problems:
- the stores start slower and stay in the background, annoying users.
- they arent even updating but just fetching updates, and still take so much time and resources. Stopping it leads to crashes on Plasma6 currently, 50% of the time.
- it makes them really unpleasing to use for searching and installing Flatpak apps, which should be their only use case (apart from firmware updates)
- also, the integration shows 2 rpm software sources, which is bad UX, confusing and not practical (it makes installing multiple RPMs nearly impossible) and also leads people to think layering was a supported use case which it is not
So, how to solve this?
I thought it wasnt possible to fulfull the requirements that make automatic rpm-ostree updates practical, while it is not!
- only update on power (AC) connected (optional but may be required)
- only update when the battery is over a certain percentage
- do not update when the network is metered, i.e. a phone hotspot or USB-tethered network.
- only run when the machine is at idle, as rpm-ostree needs lots of power (at least when layering)
All these are crucial as not having them could cause data loss or completely consumed cell data plans.
Not having auto-updates makes atomic desktops currently not fool-proof.
(On a Desktop PC you can just comment out the lines to remove the checks)
But all these are possible using systemd, we can add requirements to be fulfilled for the service to run, and easily check if AC is connected, battery is over x % or if the currently active network is not metered.
The idea is
- have a service that checks these and repeats every 15min if it failed
- have a seperate timer that activates the service. That timer actually gives the interval you want your updates to happen
Have a look at my way, I have the feeling there are some hacky parts (e.g. getting the metered state of the currently active network).
I have included a logging service, so that I can try and report if it is practical.
The defaults are sane, but a GUI in systemsettings/gnome settings for changing
- only on AC
- only with battery percentage over
40
- only on idle
15
(With the possibility to change the values) would also be cool.
This will make automatic updates possible and decouple the need to integrate them in the software stores, making them quick again.
(As a workaround, rpm-ostree override remove plasma-discover-rpm-ostree
or gnome-software-rpm-ostree
works)