Implement offline updates
# Intro
[systemd offline updates](https://www.freedesktop.org/software/systemd/man/latest/systemd.offline-updates.html?__goaway_challenge=meta-refresh&__goaway_id=87e73bcc084c955e55ec412ae6f2c509) is a process for downloading packages while the system is in its normal state, rebooting into a minimal environment to apply them, and then rebooting again back into the full environment.
This would be beneficial in that it would solve issues with GUI crashing while updating (especially during release upgrades), killing the apk process that was doing the upgrade and potentially bricking the system. This would also make updates more robust, as running programs would not be loading based on the older, pre-upgrade libraries. Finally, kernel upgrades would be safer as the amount of time that the system is not running the newer version would be minimized.
> The package manager prepares system updates by downloading all (.rpm or
> .deb or whatever) packages to update off-line in a special directory /var
> lib/system-update (or another directory of the package/upgrade manager's
> choice).
apk cache download handles this for us already, but it obviously installs to `/var/cache/apk/` instead of `/var/lib/system-update/`. Would we want to use the system-update directory for this process only and use the apk cache directory for manual invocations of apk? If we *do* use the cache directory, we would have to clear it automatically since we don't do that.
> When the user OK'ed the update, the symlink /system-update or /etc/system
> update is created
How does the user OK the update in this case? I assume the software centers, but how does apk signal to them that there is an upgrade available?
issue