table of contents
- Tumbleweed 5.1.0-1.1
- Leap-16.0
- Leap-15.6
TRANSACTIONAL-UPDAT(8) | transactional-update | TRANSACTIONAL-UPDAT(8) |
NAME¶
transactional-update, transactional-update.service, transactional-update.timer - Apply updates to the system in an atomic way via transactional updates.
SYNOPSIS¶
transactional-update [options...] [general-command...] [package-command [command-argument...]]
transactional-update [options...] standalone-command
transactional-update.service
transactional-update.timer
DESCRIPTION¶
transactional-update updates the system in a transactional way; this means updates are atomic, so either the patches are fully applied or nothing is changed. The update does not influence the running system and it can be rolled back. To activate the changes, the system needs to be rebooted.
To achieve this transactional-update is using Btrfs' snapshot mechanism, combined with the default distribution tools. Whenever an update of the root file system is going to be performed, snapper(8) will create a new snapshot of the root file system first. This new snapshot is then used to perform the update, e.g. by calling zypper(8) with the -R option pointing to the new snapshot. If no errors occured the snapshot will be set as the new default snapshot and set as read-only. In case of errors the snapshot will be deleted again.
By default the snapshot is always branched off from the current root file system, i.e. calling transactional-update multiple times without rebooting will create separate, independent snapshots, not containing the changes of the previous run. If multiple consecutive actions are to be executed, the --continue option can be used. This will still create a separate snapshot for each call, so it is possible to roll back to previous intermediate steps in case of errors.
On read-only systems each snapshot will contain a nested /etc subvolume. As configuration files may be modified after a snapshot was created and before a reboot is performed (e.g. via configuration management software) on first boot into the new snapshot the service transactional-update-sync-etc-state.service will copy these files into the new snapshot if they weren't also changed there.
Warning
If a file in /etc has been changed during the update and is also changed in the running system after the snapshot has been taken, then only the version of the new snapshot will be visible after a reboot.
Older transactional-update versions were using multiple /etc overlays instead of BTRFS subvolumes; a migration mechanism is in place, the directories will still be removed if no snapshot is using them any more.
On read-write systems please be aware that all changes done to the running root filesystem after snapshot creation are lost after the next reboot. For this reason the system should be rebooted as fast as possible after a successful update.
For easier maintenance of big clusters, transactional-update is run by systemd.timer(5) in regular intervals. The specific time can be configured in /etc/systemd/system/transactional-update.timer.d/local.conf. See systemd.unit(5) for more information.
COMMANDS¶
If none of the following commands is given, the value of UPDATE_METHOD in transactional-update.conf(5) will be assumed.
General Commands¶
General Commands can be used together in any combination; additionally they can be extended with one Package Command. The order of the General Commands doesn't matter.
apply
Note that - in contrast to regular zypper updates - services will not be restarted automatically. Additionally mounting the three directories is not one atomic operation, so there will be a short timespan where the directories visible to the system will not be in sync.
cleanup
cleanup-snapshots
cleanup-overlays
grub.cfg
bootloader
initrd
kdump
reboot
Several different reboot methods are supported, configurable via the REBOOT_METHOD configuration option in transactional-update.conf(5). By default rebootmgrd(8) will be used to reboot the system according to the configured policies if the service is running, otherwise systemctl reboot will be called.
run cmd
This command consumes all the remaining parameters, so should be placed in the last position.
To use features like command lists (e.g. pipes or separators) wrap the script into a Shell command like such as
transactional-update run bash -c ' ls && date if [ true ]; then echo -n "Hello " echo '\''world'\'' fi '
setup-fips
This command can not be combined with any Package Command other than install.
setup-kdump [--crashkernel=low[,high]]
This command can not be combined with any Package Command other than install.
setup-selinux
This command can not be combined with any Package Command other than install.
shell
Package Commands¶
Package Commands will invoke zypper(8) to perform actions on the RPM packages. Only one Package Command can be used at the same time. Can be combined with any number of General Commands.
By default commands usually invoked from scripts are called in non-interactive mode (assuming the default answer in case of questions), commands typically called by the user are called in interactive mode. The behaviour can be changed or enforced using the --interactive respectively the --non-interactive options.
To facilitate scripting Package Commands will exit early if no packages were updated; if combined with General Commands those will not be executed any more in that case.
Non-interactive Package Commands
dist-upgrade, dup
update, up
patch
register arguments
This command implies the --drop-if-no-change option to avoid creation of unnecessary snapshots, as many of the SUSEConnect options are read-only or only require access to /etc.
SUSEConnect is always a non-interactive command.
Interactive Package Commands
migration arguments
These arguments can be any zypper-migration(8) argument, with the exception of "--root", as this is handled by transactional-update dynamically.
pkg command arguments
install, in
remove, rm
update, up
apply-oci --image image source
Warning
This command is under development and will change in the future. There are no checks whether the image will boot so far, and the functionality is not available via API / D-Bus yet.
Standalone Commands¶
rollback [number]
If no snapshot number is given, the current root file system is set as the new default root file system. Otherwise number can either be a snapshot number (as displayed by snapper list) or the word last. last will try to reset to the latest working snapshot.
This command can be combind with the apply command to make the snapshot effective immediately.
OPTIONS¶
--interactive, -i
--non-interactive, -n
--continue [number], -c [number]
--no-selfupdate
--drop-if-no-change, -d
--keep, -k
--quiet
--help, -h
--version
EXIT STATUS¶
0
1
2
IMPORTANT¶
Only RPMs which are fully part of the root filesystem and /etc can be updated. There is also limited handling for adding files and directories to /var, however modifications of existing files (e.g. migrating databases) are supposed to be handled by systemd jobs at startup (see the initial configuration and deployment section of the packaging guidelines[1]).
Since all changes to the root filesystem will get lost after creating the snapshot for the update, the system should be rebooted as fast as possible after the update finished.
Every time transactional-update will create a new snapshot it will be based on the currently running system. Calling transactional-update multiple times without rebooting will not include the changes of the previous snapshot, thus effectively discarding all previous changes (except when using --continue to explicitly continue a previous snapshot or when apply was called previously).
SEE ALSO¶
transactional-update.conf(5), tukit.conf(5), systemd.timer(5), systemd.time(7), The Transactional Update Guide[2]
AUTHOR¶
Thorsten Kukuk <kukuk@suse.com>
NOTES¶
- 1.
- initial configuration and deployment section of the packaging guidelines
- 2.
- The Transactional Update Guide
08/18/2025 | transactional-update |