更新、升级与回滚

Installing updates with Fedora Silverblue is easy and fast. It also has a special rollback feature, in case anything goes wrong. Additionally, you can choose to have multiple versions of your operating system installed at all times, and you can choose which one to boot into whenever you start up your system.

更新 Fedora Silverblue

OS updates are fully integrated into the desktop; you will be automatically notified when an update is available. The standard behavior is to automatically download the update (this can be changed from the update preferences in Software).

当更新准备就绪,只需要重启系统就可以使用新版本。重启时不需要耗费额外的时间以应用更新。

当然,你也可以在命令行下执行更新:

$ rpm-ostree upgrade

这会检查更新并在更新可用时立刻获取它们。如果你只希望检查更新而不希望执行下载:

$ rpm-ostree upgrade --check

主要版本间升级

Upgrading between major versions (such as from Fedora 38 to Fedora 39) can be completed using the GNOME Software application. Alternatively, Fedora Silverblue can be upgraded between major versions using the rpm-ostree command.

Skipping major releases is currently untested and is thus not supported. You should update only one major release at a time, i.e. from Fedora 38 to 39, etc.

First, make sure that you are running the latest update for the current version:

$ rpm-ostree upgrade

Reboot your system if needed. Then, verify that the branch for the next major version is available. You can print all available branches for Fedora Silverblue with this command:

$ ostree remote refs fedora | grep silverblue | grep $(uname -m)

After you’ve verified the name of your branch, you are ready to proceed. For example, to upgrade to Fedora Silverblue 39, the command is:

$ rpm-ostree rebase fedora:fedora/39/x86_64/silverblue
Currently, the default remote for Fedora Silverblue 39 is named fedora. If this is not the case for your system, you can find out the remote name by issuing: ostree remote list.

版本间的升级和普通的更新是非常相似的:新版系统被下载到后台,你只需重启系统就可以启动新系统。

Additionally, you can choose to rebase to a different immutable variant of Fedora, like for example Fedora Kinoite. Fedora Kinoite is similar to Fedora Silverblue, except for the fact that it uses the KDE Plasma desktop environment instead of the default GNOME desktop environment.

What this means is, you can rebase to Fedora Kinoite to try it out, without ever touching your current system. Because the two system images are isolated from eachother, the two desktop environments will never be installed at the same time. All of your flatpak apps and /home files will stay persistent between rebases. Same applies for testing out the bleeding-edge version of Fedora Silverblue, which is Rawhide.

If you decide to rebase, make sure to pin your current deployment, so you don’t accidentaly lose it (by default, only the two most recent deployments are kept).

回滚

Fedora Silverblue 保留了上一版系统的备份,你可以随时从新版系统切换回去。尽管通常情况我们用不上这一特性,但当更新或版本间升级出现问题,回滚功能就会派上用场。

回滚到旧版本有两种方法:

  1. 临时回滚:要临时地切换到上一版的系统,只需要重启并在启动选单(也就是 GRUB 引导菜单)中选择旧版系统就可以了。

  2. 永久回滚:要回滚到旧版本并希望回滚持续生效,你可以使用 rpm-ostree rollback 命令。

当回滚完成后,在技术角度你就回到了旧版的系统,这时候系统可能会提示你更新。更新会导致回滚操作被撤销,所以要使回滚操作持续生效就得避免更新。

rpm-ostree only keeps one rollback version available by default. If you want to rollback to another version that the one currently available on your system, you can do so with the following commands:

  1. Pull the ostree commit log from the remote repository:

    $ sudo ostree pull --commit-metadata-only --depth=10 fedora fedora/39/x86_64/silverblue
  2. Display the log:

    $ ostree log fedora:fedora/39/x86_64/silverblue
  3. Deploy a specific commit:

    $ rpm-ostree deploy 39.20230716.0

Note that this will deploy the exact version as requested and will not include overlayed packages and other changes.