LinuxCommandLibrary

bootc-switch

Switch bootable bootc operating system deployments

TLDR

Change the base OS to a new container image from a registry

$ sudo bootc switch [image]
copy

Change the base OS to a new container image from the local image storage of the root user
$ sudo bootc switch --transport containers-storage [image]
copy

Change the base OS to a new container image stored in a tarball
$ sudo bootc switch --transport oci-archive [path/to/image.tar.gz]
copy

SYNOPSIS

bootc-switch [OPTIONS...] [DEPLOYMENT]

PARAMETERS

--help
    Print help message and exit

--version
    Print version string and exit

DESCRIPTION

The bootc-switch command is part of the bootc toolkit, designed for managing atomic, OSTree-based operating system deployments on Linux. Bootc integrates with systemd-boot to handle boot entries, enabling seamless updates and rollbacks.

In OSTree systems, multiple deployments coexist: the "booted" one (current default), "pending" (staged for next boot), and others. bootc-switch re-marks a specified deployment as "booted", updating the bootloader configuration to make it the default for the next reboot. This is crucial for confirming a new deployment after testing or rolling back.

If no DEPLOYMENT is provided, it defaults to the "pending" deployment, facilitating standard update workflows: fetch, verify, switch. It requires the bootc daemon running and root privileges. Use bootc status to list deployments by index, checksum, or labels.

This command enhances reliability in server and desktop environments using OSTree, reducing downtime during updates.

CAVEATS

Requires root privileges (use sudo). Only functional in bootc-managed OSTree systems with the bootc daemon active. Does not reboot; change takes effect on next boot.

EXAMPLES

bootc-switch pending
Switch to pending deployment.

bootc-switch 0
Switch to deployment index 0 (use bootc status to check indices).

bootc-switch abc123...
Switch by deployment checksum.

DEPLOYMENT REFERENCES

DEPLOYMENT may be: index (e.g., 0), checksum prefix (e.g., abc123), or special pending.

HISTORY

Introduced in bootc 0.1.0 (early 2024) by the bootc project, led by systemd developers including Lennart Poettering. Evolved from OSTree tools to simplify deployment management in modern Linux distributions like Fedora CoreOS and Silverblue.

SEE ALSO

bootc-status(1), bootc-fetch(1), bootc-install(1), ostree-admin(1), systemd-boot(7)

Copied to clipboard