← 返回命令列表

Linux command

bootc-switch 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo bootc switch [image]

Example

sudo bootc switch --apply [image]

Example

sudo bootc switch --transport containers-storage [image]

Example

sudo bootc switch --transport oci-archive [path/to/image.tar]

说明

bootc switch changes the base operating system to a different container image. This allows switching between different OS variants or versions while maintaining a transactional, rollback-capable system. The new image is staged and becomes active on the next reboot. The previous deployment is retained for rollback if needed. This operation is similar to `bootc upgrade` but additionally changes the container image reference.

参数

--transport _type_
Image source type: registry (default), containers-storage, oci-archive
--apply
Restart or reboot into the new target image immediately after staging. Currently always performs a full reboot; future versions may use a userspace-only restart when no kernel changes are queued.
--soft-reboot _mode_
Controls soft reboot behaviour when used with --apply. Values: auto (use soft reboot if available, otherwise fall back to full reboot), required (fail if soft reboot is unavailable).
--enforce-container-sigpolicy
Require that /etc/containers/policy.json includes a default policy enforcing image signatures.
--retain
Retain a reference to the currently booted image.
--quiet
Suppress progress output.

FAQ

What is the bootc-switch command used for?

bootc switch changes the base operating system to a different container image. This allows switching between different OS variants or versions while maintaining a transactional, rollback-capable system. The new image is staged and becomes active on the next reboot. The previous deployment is retained for rollback if needed. This operation is similar to `bootc upgrade` but additionally changes the container image reference.

How do I run a basic bootc-switch example?

Run `sudo bootc switch [image]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --transport _type_ do in bootc-switch?

Image source type: registry (default), containers-storage, oci-archive