Getting Started with Fedora Silverblue
Tags: linux, tutorial, opensource
Published: 2022-08-01 15:32:03

<!-- wp:paragraph -->
<p>I have been using Ubuntu for many years to learn more Linux utilities, containers, Kubernetes and to keep up-to-date with the latest trends in the Linux world. Windows OS was easily accessible during my school and college days. macOS was rare to find in my hometown due to the expensive price tag; and I still remember Linux was distributed along with the magazines (something similar to below) in India. After using Ubuntu extensively in WSL 1 and 2 on my 7-year-old Dell laptop, I recently upgraded to Lenovo. I wanted to try something refreshing in the Linux world, so after trying various distros, I found Fedora Workstation and Fedora Silverblue fulfill my requirements. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9618,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-full"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-25.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-25.png" alt="Linux CD-ROM" class="wp-image-9618"/></a><figcaption>Linux CD-ROM</figcaption></figure>
<!-- /wp:image -->

<!-- wp:image {"align":"center","id":9619,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-26.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-26-1024x885.png" alt="Linux CD-ROM" class="wp-image-9619"/></a><figcaption>Linux CD-ROM</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Credit: https://opensource.com/article/19/11/learning-linux-90s </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Backstory and my Upgraded Gear</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>After saving money from past many months and carefully watching for the deals, finally I was able to afford to upgrade my laptop. I was using Dell Inspiron 13 5378 Intel i5 sixth generation which I got from Dell back in 2016. It had a good run, but the battery died after five years, I was running in always-ON power mode. Most of the time, I don't carry my laptop due to pandemic; otherwise I used to go to the nearest Starbucks or the library on the weekends to learn. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>A couple of months ago, I stumbled upon this excellent deal from Costco where you can grab a Lenovo Legion Slim 7 15" Gaming laptop for $1515 including tax and shipping. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I am not a hardcore gamer, but I play it only on my Xbox. I was looking for more RAM instead of more cores. It is one of the best investments I made in recent years. AMD is really fast (first time I have tried AMD chip). The only issue I found was the keyboard lighting settings will be reset with every restart. I use an external keyboard, so I really don't mind. But the laptop keyboard is excellent. Enough of my bragging :), let us get back to Fedora.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>Lenovo LEGION Slim 7 15" Gaming Laptop 
AMD Ryzen 9 5900HX - 8 Cores - 16 Threads
GeForce RTX 3060 Max-Q
165HZ 1080p
Windows 11 
Shadow Black
32GB RAM
1 TB SSD</code></pre>
<!-- /wp:code -->

<!-- wp:generateblocks/headline {"uniqueId":"c8d05d63"} -->
<h2 class="gb-headline gb-headline-c8d05d63 gb-headline-text">Fedora Ecosystem</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>As you are already aware, Fedora is the upstream to Red Hat Enterprise Linux. In the Fedora ecosystem, you get six different flavors of Linux:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li><em>Workstation </em>for personal computer</li><li><em>Server</em>&nbsp;for&nbsp;servers</li><li><em>CoreOS</em> for cloud computing</li><li>Silverblue GNOME <em>based </em>immutable&nbsp;desktop specialized for developers who work on container-based workflows</li><li><em>Kinoite</em> KDE Plasma based immutable desktop</li><li><em>IoT</em> for IoT&nbsp;devices</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>CoreOS and <a href="https://silverblue.fedoraproject.org">Silverblue</a> are emerging in the Fedora ecosystem. It may replace other flavors in the future. </p>
<!-- /wp:paragraph -->

<!-- wp:generateblocks/headline {"uniqueId":"5f2cdc0b"} -->
<h2 class="gb-headline gb-headline-5f2cdc0b gb-headline-text">Immutable OS</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>The difference between CoreOS and Silverblue is: the former is minimal, automatic updating and best for containerized workflows with no GUI; the latter is GNOME-based, immutable desktop, and best for containerized workflows. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Immutable desktop helps in keeping the OS more stable and fewer bugs prone due to the atomic nature. What is atomic? During OS upgrades, possibly two things can happen. One is a successful upgrade with no errors. Second, the upgrade may fail. In case of failure, the OS will revert  to the previous state. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>How Fedora CoreOS or Silverblue achieves immutability. Enter <code>rpm-ostree</code>. </p>
<!-- /wp:paragraph -->

<!-- wp:generateblocks/headline {"uniqueId":"6a6d2572"} -->
<h2 class="gb-headline gb-headline-6a6d2572 gb-headline-text">rpm-ostree</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p><code>rpm-ostree</code> is a hybrid package system. Think of it like a git for OS. <code>rpm-ostree</code> is integrated with CoreOS, IOT and Silverblue. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Use <code>rpm-ostree</code> only when you want to create layered packages. To install the apps use Flatpak (see below).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To learn about <code>rpm-ostree</code> let us spin up Fedora Silverblue in VMWare Workstation. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Download the ISO from <a href="https://silverblue.fedoraproject.org/download" target="_blank" rel="noreferrer noopener">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Upon launching the terminal in Silverblue, you will get the below message.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9623,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-full"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-27.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-27.png" alt="Welcome message in Terminal in Fedora Silverblue" class="wp-image-9623"/></a><figcaption>Welcome message in Terminal in Fedora Silverblue</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Basically, you do not get <code>dnf</code> or <code>yum</code> installed in Fedora Silverblue, but we do have <code>rpm-ostree</code> to install the apps.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9624,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-full"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-28.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-28.png" alt="rpm-ostree in Fedora Silverblue" class="wp-image-9624"/></a><figcaption>rpm-ostree in Fedora Silverblue</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The RPMs are coming from the <code>/etc/yum.repos.d</code> folder as shown below.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9625,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-29.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-29-1024x603.png" alt="rpm-ostree repos" class="wp-image-9625"/></a><figcaption>rpm-ostree repos</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Let us focus on installing, upgrading, rebasing and rollback on the host system. In the next blog, we can see about the <code>toolbox</code> for the containerized workflow.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Below are the commands which help in administering the host system. </p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>rpm-ostree status -v

rpm-ostree upgrade

rpm-ostree rollback

rpm-ostree deploy &lt;version&gt;

rpm-ostree install &lt;pkg&gt;

rpm-ostree uninstall &lt;pkg&gt;

rpm-ostree rebase -b $branchname</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>The inception command is <code>status</code>. <code>status</code> command shows the deployments in the order. The circle prefix as shown below shows that the current booted deployment. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9628,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-31.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-31-1024x311.png" alt="rpm-ostree status" class="wp-image-9628"/></a><figcaption>rpm-ostree status</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Now, let us upgrade the image to the latest using <code>rpm-ostree upgrade</code> command and then reboot using the <code>systemctl reboot</code> command.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After upgrading and rebooting, let us issue the <code>status</code> command. You can see that there is a new current deployment.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9631,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-32.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-32-1024x356.png" alt="New Deployment" class="wp-image-9631"/></a><figcaption>New Deployment</figcaption></figure>
<!-- /wp:image -->

<!-- wp:generateblocks/headline {"uniqueId":"a9bb6439"} -->
<h2 class="gb-headline gb-headline-a9bb6439 gb-headline-text">Layered Packages</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>Whenever you make changes, it will get versioned and layered. Let us install a couple of packages using <code>rpm-ostree</code> and reboot again. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Issue the below command to install git, nginx and konsole.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><code>rpm-ostree install git nginx konsole</code></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After rebooting, launch terminal and verify the versions of git, nginx, and konsole as shown below.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9632,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-full"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-33.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-33.png" alt="Check version" class="wp-image-9632"/></a><figcaption>Check version</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Let us issue the <code>status</code> command again.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9633,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-34.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-34-1024x370.png" alt="rpm-ostree status after layering" class="wp-image-9633"/></a><figcaption>rpm-ostree status after layering</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Let us install <code>caddy</code> and uninstall <code>nginx</code> using the below commands.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>rpm-ostree install caddy

rpm-ostree uninstall nginx

systemctl reboot</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>Here is the <code>status</code> output.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9636,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-35.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-35-1024x378.png" alt="" class="wp-image-9636"/></a><figcaption>Updated status</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Now, let us roll back with git, konsole, and nginx using the below command and reboot.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>rpm-ostree rollback -r</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>nginx is back again.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9637,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-36.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-36-1024x390.png" alt="nginx is back" class="wp-image-9637"/></a><figcaption>nginx is back</figcaption></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Here is the verbose output of <code>rpm-ostree status -v</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9639,"sizeSlug":"large","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-37.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-37-1024x818.png" alt="verbose status" class="wp-image-9639"/></a><figcaption>verbose status</figcaption></figure>
<!-- /wp:image -->

<!-- wp:generateblocks/headline {"uniqueId":"3c86b42e"} -->
<h2 class="gb-headline gb-headline-3c86b42e gb-headline-text">When to use package layering?</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>As I mentioned earlier, you should avoid using <code>rpm-ostree</code> to install the apps. Use <code>rpm-ostree</code> to install drivers, libvirt, etc. </p>
<!-- /wp:paragraph -->

<!-- wp:generateblocks/headline {"uniqueId":"5f57c751"} -->
<h2 class="gb-headline gb-headline-5f57c751 gb-headline-text">Installing Apps using Flatpak</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>Now let us install apps using Flatpak. Flatpak is the easy way to install apps to your Silverblue host using its GUI. Download and install <a href="https://flatpak.org/setup/Fedora" target="_blank" rel="noreferrer noopener">Flathub repo file</a>. Once the installation is done, navigate to <a href="https://flathub.org/home" target="_blank" rel="noreferrer noopener">Flathub</a> to search and install your desired apps. Use Flathub to install the GUI based apps like LibreWolf, gedit, and more</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":9641,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image aligncenter size-full"><a href="https://qainsights.com/wp-content/uploads/2022/07/image-38.png"><img src="https://qainsights.com/wp-content/uploads/2022/07/image-38.png" alt="Librewolf in Flathub" class="wp-image-9641"/></a><figcaption>Librewolf in Flathub</figcaption></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Toolbox</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Toolbox is the recommended way to install CLI apps, container apps, development tools and more. We will deep-dive into Toolbox in the next blog.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Closing Thoughts</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Immutable OS is the future; as it provides stability, reliability, and security. Dedicated ecosystem for container based workflows boosts developer productivity. The GNOME environment helps to easily get started for general users. Fedora Silverblue has a long way to go. But the immutable desktops will not be a fad. </p>
<!-- /wp:paragraph -->