开始使用

Silverblue is designed to be easy and straightforward to use, and specialist knowledge should generally not be required. However, Silverblue is built differently from other operating systems, and there are therefore some things that it is useful to know.

Silverblue has different options for installing software, compared with a standard Fedora Workstation (or other package-based Linux distributions). These include:

  • Flatpak apps: this is the primary way that (GUI) apps get installed on Silverblue.

  • Toolbox:安装命令行应用的主要方式,也是开发调试主要使用的工具。

  • 软件包层叠:rpm-ostree 使得混合映像/软件包系统成为可能。在默认设置下,系统以纯映像模式运行,而软件包层叠为虚拟化、驱动等提供了支持。

要想了解有关 Flatpak软件包层叠 有关的更多信息,请继续阅读。

要想了解 Toolbox,有 专门的页面 可供查阅。

Flatpak

Flatpak is the primary way that apps can be installed on Silverblue (for more information, see flatpak.org). Flatpak works out of the box in Fedora Silverblue, and Fedora provides a small (but growing) collection of apps that can be installed.

Flatpak 应用程序的另一主要来源是 Flathub ,Flathub 提供了大量的 Flatpak 应用程序供用户选用。

初始化 Flathub

To setup Flathub on Fedora Silverblue, open the Flathub setup page for Fedora and click the “Flathub repository file” button to download the Flathub configuration.

sfg flathub fedora
Figure 1. Fedora 快速设置页

A popup window will show a download option for the file. The “Open with” option should show “Software Install (default)”. Click on the “OK” button to start the download.

sfg flathub download
Figure 2. Flathub 下载选项

After the download is complete, a new window will open showing the Flathub repository. This window also shows the source location of the repository to be installed, under the details heading (1). To start the installation of the Flathub repository, click on the “Install” button (2).

sfg flathub install
Figure 3. Flathub 安装向导

当软件源安装完成,『安装』按钮就会被『移除』按钮取代。

从 Flathub 安装 Flatpak 应用程序

Once the Flathub repository has been setup, it can be used to install Flatpak apps. This can be done directly from the Software app, or apps can be browsed on the Flathub website.

If you choose to install apps from the Flathub website, clicking "Install" will download a file which will be opened by the Software app, which can then be used to install the app. For example, to install LibreOffice, you first search for and open the LibreOffice page, and then press the “Install” button (2).

After clicking the “Install” button, a download information window will be shown. Verify the correct Flatpak has been downloaded and then click on the “OK” button to begin installing the LibreOffice application.

sfg libreoffice install
Figure 4. 下载 LibreOffice Flatpak

Once the Flatpak is downloaded, the Software application will open a new window with an “Install” button (2). Click this button to begin installation.

Flatpak 命令行工具

In addition to using the Software app to install Flatpak apps, it is also possible to use the flatpak command line interface. See the Flatpak documentation for how to do this.

软件包层叠

Package layering works by modifying your Silverblue installation. As the name implies, it works by extending the packages from which Silverblue is composed.

适合软件包层叠的一些好例子包括:

  • fish:一个备选的 UNIX Shell

  • sway:一个基于 Wayland 的平铺窗口管理器

  • libvirt:libvirt 守护进程

Most (but not all) RPM packages provided by Fedora can be installed on Silverblue using this method.

Currently, using package layering creates a new "deployment", or bootable filesystem root. It does not affect your current root. This preserves rollback and the transactional model, but means that the system must be rebooted after a package has been layered. If you don’t want to reboot your system for switching to the new deployment, you can use an experimental rpm-ostree ex apply-live command to update the filesystem to see changes from new deployment, but it’s generally expected that you use package layering sparingly, and use flatpak and dnf install inside a toolbox etc.

Package layering is generally done from the command line. However, the Software application does rely on it for installing a small number of apps that are currently difficult to install as Flatpaks.

安装软件包

Packages can be installed on Silverblue using:

$ rpm-ostree install <package name>

This will download the package and any required dependencies, and recompose your Silverblue image with them. rpm-ostree uses standard Fedora package names, which can be searched using DNF (this is not available on a Silverblue host, but can be used in a toolbox).

当软件包通过这种方式安装之后,它就会随着 Silverblue 映像一起保持着最新状态。

替换软件包

In some scenarios, you may want to test out a new version of podman or kernel or other packages that live on the host. The rpm-ostree override command can be used to replace a package with a different version. You can download the package locally and run:

$ rpm-ostree override replace <path to package>

Or you can override packages without downloading using links from koji or bodhi. For example:

$ rpm-ostree override replace https://kojipkgs.fedoraproject.org//packages/podman/3.1.2/1.fc34/x86_64/podman-3.1.2-1.fc34.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/podman/3.1.2/1.fc34/x86_64/podman-plugins-3.1.2-1.fc34.x86_64.rpm

你也可以使用 override remove 来隐藏一个软件包;它们仍在底层映像中,但他们不会在部署的系统中出现。

Removing and replacing packages using package layering is not generally recommended. For more information, see the rpm-ostree documentation.