table of contents
| SYSTEMD-SYSUPDATE(8) | systemd-sysupdate | SYSTEMD-SYSUPDATE(8) |
NAME¶
systemd-sysupdate, systemd-sysupdate-update.service, systemd-sysupdate-update.timer, systemd-sysupdate-reboot.service, systemd-sysupdate-reboot.timer, systemd-sysupdate-auto-enable.service, systemd-sysupdate.service, systemd-sysupdate.timer - Automatically Update OS or Other Resources
SYNOPSIS¶
systemd-sysupdate [OPTIONS...]
systemd-sysupdate-update.service
EXPERIMENTAL¶
This component is experimental and subject to change at any given moment without notice. It will be stabilized and given a backward-compatibility guarantee in a future release.
DESCRIPTION¶
systemd-sysupdate atomically updates the host OS, container images, portable service images or other sources, based on the transfer configuration files described in sysupdate.d(5).
This tool implements file, directory, or partition based update schemes, supporting multiple parallel installed versions of specific resources in an A/B (or even: A/B/C, A/B/C/D/, ...) style. A/B updating means that when one version of a resource is currently being used, the next version can be downloaded, unpacked, and prepared in an entirely separate location, independently of the first, and — once complete — be activated, swapping the roles so that it becomes the used one and the previously used one becomes the one that is replaced by the next update, and so on. The resources to update are defined in transfer files, one for each resource to be updated. For example, resources that may be updated with this tool could be: a root file system partition, a matching Verity partition plus one kernel image. The combination of the three would be considered a complete OS update.
The tool updates partitions, files or directory trees always in whole, and operates with at least two versions of each of these resources: the current version, plus the next version: the one that is being updated to, and which is initially incomplete as the downloaded data is written to it; plus optionally more versions. Once the download of a newer version is complete it becomes the current version, releasing the version previously considered current for deletion/replacement/updating.
When installing new versions the tool will directly download, decompress, unpack and write the new version into the destination. This is done in a robust fashion so that an incomplete download can be recognized on next invocation, and flushed out before a new attempt is initiated.
Note that when writing updates to a partition, the partition has to exist already, as systemd-sysupdate will not automatically create new partitions. Use a tool such as systemd-repart(8) to automatically create additional partitions to be used with systemd-sysupdate on boot.
The tool can both be used on the running OS, to update the OS in "online" state from within itself, and on "offline" disk images, to update them from the outside based on transfer files embedded in the disk images. For the latter, see --image= below. The latter is particularly interesting to update container images or portable service images.
The systemd-sysupdate-update.service system service will automatically update the host OS based on the installed transfer files. It is triggered in regular intervals via systemd-sysupdate-update.timer. The systemd-sysupdate-reboot.service will automatically reboot the system after a new version is installed. It is triggered via systemd-sysupdate-reboot.timer. The two services are separate from each other as it is typically advisable to download updates regularly while the system is up, but delay reboots until the appropriate time (i.e. typically at night). The two sets of service/timer units may be enabled separately.
The systemd-sysupdate-auto-enable.service system service automatically enables all suggested components and all suggested features of all components before each update. It is ordered before and pulled in by systemd-sysupdate-update.service, and is not enabled by default. Enable it if newly suggested components and features shall be picked up automatically as they become available, rather than requiring manual enable-component/enable-feature invocations.
For details about transfer files and examples see sysupdate.d(5).
COMMAND¶
The following commands are understood:
list [VERSION]
If no command is explicitly specified this command is implied.
Added in version 251.
features [FEATURE]
Added in version 257.
enable-feature FEATURE..., disable-feature FEATURE...
Added in version 262.
check-new
Added in version 251.
update [--offline] [VERSION]
If --offline is specified, the update must already have been acquired using acquire and, if so, this pre-acquired version is the one which will be updated to.
Added in version 251.
acquire [VERSION]
If a new version to install/update to is found, old installed versions are deleted until at least one new version can be installed, as configured via InstanceMax= in sysupdate.d(5), or via the available partition slots of the right type. This implicit operation can also be invoked explicitly via the vacuum command described below.
Added in version 260.
vacuum
Added in version 251.
pending
Added in version 251.
reboot
Added in version 251.
components
Added in version 251.
enable-component COMPONENT..., disable-component COMPONENT...
Added in version 262.
cleanup
By default only the selected component is processed (i.e. the one selected via --component=, or the default one if none were selected). Use --component-all to process all components known to the installation database in a single invocation.
This operation only removes files that were installed into the file system (i.e. resources of type "regular-file", "directory" and "subvolume", see sysupdate.d(5)); it does not touch partition-based resources.
Added in version 262.
-h, --help
--version
OPTIONS¶
The following options are understood:
--component=, -C
Use the components command to list available components to update. This enumerates the directories matching this naming rule.
Components may be used to define a separate set of transfer files for different components of the OS that shall be updated separately. Do not use this concept for resources that shall always be updated together in a synchronous fashion. Simply define multiple transfer files within the same sysupdate.d/ directory for these cases.
This option may not be combined with --definitions=, nor with the pending and reboot commands or the --reboot switch, which only apply to the booted OS version.
Added in version 251.
--component-all, -A
This option may not be combined with --component=.
Added in version 262.
--component-suggested, -S
This option may not be combined with --component=.
In order to reconcile the system according to suggestions, i.e., to also turn off the components that are not (or no longer) suggested, first disable all components with --component-all, then enable the suggested ones with this switch. Note that this has wider consequences than the equivalent reconciliation of optional features because components are enabled by default, and a component counts as not suggested unless Suggest= or one of the SuggestOn...= settings says otherwise. Reconciling hence explicitly disables every component that is not suggested, including components that ship no *.component file at all. The default component is not affected.
Added in version 262.
--feature-all, -a
Added in version 262.
--feature-suggested, -s
In order to reconcile the system according to suggestions, i.e., to also turn off the features that are not (or no longer) suggested, first disable all features with --feature-all, then enable the suggested ones with this switch.
Added in version 262.
--definitions=
This option may not be combined with --component=.
Added in version 251.
--root=
Added in version 251.
--image=
Added in version 251.
--image-policy=policy
--instances-max=, -m
Added in version 251.
--sync=
Added in version 251.
--verify=
Added in version 251.
--reboot
Added in version 251.
--cleanup=
Added in version 262.
--offline
If used in combination with the update command, it allows updates to be downloaded in advance (using acquire) and installed later.
Added in version 257.
--transfer-source=
Added in version 257.
--no-pager
--no-legend
--json=MODE
EXIT STATUS¶
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO¶
systemd(1), sysupdate.d(5), sysupdate.features(5), sysupdate.components(5), systemd-sysupdated.service(8), systemd-repart(8)
| systemd 262~rc1 |