I recently switched to Fedora Silverblue, the immutable desktop version of Fedora. With Silverblue, rebasing is easy – even when I had to downgrade from Rawhide to a stable release!
Fedora Silverblue is an interesting attempt at providing an immutable operating system – targeted at desktop users. Using it on a daily base helps me to get more familiar with the toolset and the ideas behind it which are also used in other projects like Fedora Atomic or Fedora CoreOS.
Rawhide is the rolling release/development branch of Fedora, and is way too unstable for my daily usage. But I only discovered this when I had it already installed and spent quite some time on customizing it.
But Silverblue is an immutable distribution, so switching to a previous version should be no problem, right? And in fact, yes, it is very easy!
Silverblue supports rebasing, switching between different branches. To get a list of available branches, first list the name of the remote source, and afterwards query the available references/branches:
[liquidat@heisenberg ~]$ ostree remote list fedora [liquidat@heisenberg ~]$ ostree remote refs fedora [...] fedora:fedora/30/x86_64/silverblue fedora:fedora/30/x86_64/testing/silverblue fedora:fedora/30/x86_64/updates/silverblue [...] fedora:fedora/rawhide/x86_64/silverblue fedora:fedora/rawhide/x86_64/workstation
The list is quite long, and does list multiple operating system versions.
In my case I was on the rawhide branch and tried to rebase to version 30. That however failed:
[liquidat@heisenberg ~]$ rpm-ostree rebase fedora/30/x86_64/silverblue 1 metadata, 0 content objects fetched; 569 B transferred in 4 seconds Checking out tree 7420c3a... done Enabled rpm-md repositories: rawhide Updating metadata for 'rawhide'... done rpm-md repo 'rawhide'; generated: 2019-05-13T08:01:20Z Importing rpm-md... done ⠁ Forbidden base package replacements: libgcc 9.1.1-1.fc30 -> 9.1.1-1.fc31 (rawhide) libgomp 9.1.1-1.fc30 -> 9.1.1-1.fc31 (rawhide) This likely means that some of your layered packages have requirements on newer or older versions of some base packages. `rpm-ostree cleanup -m` may help. For more details, see: https://githResolving dependencies... done error: Some base packages would be replaced
The problem was that I had installed additional packages in the meantime. Note that there are multiple ways to install packages in Silverblue:
– Flatpak apps: this is the primary way that apps get installed on Silverblue.
– Containers: which can be installed and used for development purposes.
– Toolbox containers: a special kind of container that are tailored to be used as a software development environment.
The other method of installing software on Silverblue is package layering. This is different from the other methods, and goes against the general principle of immutability. Package layering adds individual packages to the Silverblue system, and in so doing modifies the operating system.https://docs.fedoraproject.org/en-US/fedora-silverblue/getting-started/
While Flatpak in itself is a pretty cool solution to the Linux desktop packaging problem it usually comes with sandboxed environments, making it less usable for integrated tools and libraries.
For that reason it is still possible to install RPMs on top, in a layered form. This however might result in dependency issues when the underlying image is supposed to change.
This is exactly what happened here: I had additional software installed, which depended on some specific versions of the underlying image. So I had to remove those:
[liquidat@heisenberg ~]$ rpm-ostree uninstall fedora-workstation-repositories golang pass vim zsh
Afterwards it was easy to rebase the entire system onto a different branch or – in my case – a different version of the same branch:
[liquidat@heisenberg ~]$ rpm-ostree rebase fedora/30/x86_64/silverblue 1 metadata, 0 content objects fetched; 569 B transferred in 2 seconds Staging deployment... done Freed: 47,4 MB (pkgcache branches: 0) liberation-fonts-common 1:2.00.3-3.fc30 -> 1:2.00.5-1.fc30 [...] Downgraded: GConf2 3.2.6-26.fc31 -> 3.2.6-26.fc30 [...] Removed: fedora-repos-rawhide-31-0.2.noarch [...] Added: PackageKit-gstreamer-plugin-1.1.12-5.fc30.x86_64 [...] Run "systemctl reboot" to start a reboot
And that’s it – after a short
systemctl reboot the machine was back, running Fedora 30. And since ostree works with images the reboot went smooth and quick, long sessions of installing/updating software during shutdown or reboot are not necessary with such a setup!
In conclusion I must say that I am pretty impressed – both by the concept as well as the execution on the concept, how well Silverblue works in a day to day situation even as a desktop. My next step will be to test it on a Laptop on the ride, and see if other problems come up there.