Skip to main content

After various days of hard work, today we’re introducing the Nitrux Update System Tool or nuts. In today’s news post, we’ll tell you all about it. How it started, why did we create it, and where can you get it? Let’s go!

Nitrux is an immutable Linux distribution, meaning no changes occur to the content of the root directory by default.

Background

Most people would be familiar with this change occurring in version 2.6.0; however, we have already traversed this road. In late 2018, we released the first version of Nitrux that was genuinely immutable, Nitrux 1.1.0. Unfortunately, only one and a half years later, in early 2020, by version 1.2.7, we had to return to the traditional workflow for many reasons. From abysmal misunderstandings to our mistakes in communicating the information correctly (and promptly), leading to an insurmountable amount of backlash, perhaps we were too early. As the adage goes, one learns from making mistakes.

But that’s well in the past; now, fast-forward to 2023, immutable Linux distributions are trending, and here we go again—one more shot at creating an immutable Linux distribution where the package manager is not an integral part of the distribution. As we often say, the preferred method to obtain software is to use AppImages; Flatpaks are also supported, as are Distrobox containers and other methods, such as Homebrew for Linux. However, these methods work great for obtaining software, yet none target the system, the distribution itself. None of these methods go about updating the distribution.

As it was, version 2.6.0 had a codename; it was our first use, and with good reason. For that release, we used “ff,” which stood for Forbidden Fruit; the point was that it was a statement of the intent of the way forward for the distribution. We were ditching PackageKit and the entire institution package managers represented in Linux distributions. As I noted, […]this version of this distribution can be seen as the antithesis of the conventional Linux distribution, where a distribution is entirely devoted to its package manager, but this distribution is not. It works to drive the point home that in this distribution, AppImages are the preferred method of adding new applications, and where an AppImage is unavailable, you can use Flatpak.[…]

Albeit unlike last time, we now were prepared. Those users who still wanted to use package managers could use Distrobox, and to make things easier, we created a tutorial. Because we had the forethought that saying such a thing is borderline heresy in this environment, as I jokingly referred to in the announcement, people would be marching down with torches in anger.

Going this route meant there wasn’t a program that users would associate with upgrading the distribution, or was there? The answer will surprise you.

Have you ever wondered what happens when you open an installer and click Install? I did; you see, first, we must know the basic workflow of a package manager. What does it do when a user asks to install a package? The gist is that an archive is downloaded for package managers that use pre-compiled packages (.deb, .rpm, .tar.{xz,zst}, etc.), then that archive is extracted and its contents placed on the root; sometimes overwriting files or adding or deleting files. Of course, the package managers do other things, such as keeping track of files and directories, checking packages’ checksums and contents, interacting with package repositories to download newer packages, dealing with dependencies, and whatnot. Also, the packages are more than simple archives; they include maintainer scripts, specially formatted text files for package managers, etc.

But, in summary, they download and extract archives to the root.

What do installers do? Precisely the same thing. When we boot a Live ISO and click the installer, for example, Calamares, it will look for the SquashFS file (an archive format, by the way), mount it, and extract the contents to the root partition using rsync. Certainly, Calamares isn’t downloading a new SquashFS file; the user has already done that step by obtaining the ISO. Of course, Calamares, an installer, does other things, such as partition management, user creation, mounts configuration, bootloader configuration, etc.

But, in summary, an installer extracts archives and syncs the content to the root.

So, 1+1=2. What better way to update the root directory than using the same approach, get an archive (a SquashFS) and use rsync, et voila! Nitrux Update System Tool was born.

Indeed, it’s that simple.

Nitrux Update Tool System (nuts)

https://github.com/Nitrux/nuts

The Nitrux Update Tool System (nuts) is a utility designed to update Nitrux OS and provide a backup option for rollbacks.

⚠️ Important: The Nitrux Update Tool System (nuts) is intended to work exclusively in Nitrux OS, and using this utility in other distributions will break them or not work at all. Please do not open issues regarding this use case; they will be closed.

Overview

Nitrux Update Tool System (nuts) is a simple and minimalistic system update and rollback utility. It performs three steps:

  1. Creates a backup of the root directory using SquashFS and stores it locally.
  2. Downloads the latest ISO image using the BitTorrent protocol and updates the system using rsync.
  3. When restoring a backup, use the locally generated SquashFS file (instead of downloading an ISO).

What is Nitrux Update Tool System (nuts)

  • Minimalistic, focusing on necessary functionality.
  • A CLI utility.
  • 100% free and open-source software written entirely in POSIX-compliant scripting language.

What Nitrux Update Tool System (nuts) is not

  • A package manager.
    • Nitrux Update Tool System (nuts) does not interact with any sort of packaging format.
    • Nitrux Update Tool System (nuts) does not interact with any software “repository” either.
    • Nitrux Update Tool System (nuts) does not interact with any package manager to perform any operation.
  • An installer.
    • Nitrux Update Tool System (nuts) is inspired by the functional workflow of most Linux installers, that is, extracting a SquashFS file. However, Nitrux Update Tool System (nuts) does not handle in any way locale configuration, user creation, partition mounts, bootloader configuration, etc.
  • Solely a backup utility.
    • Nitrux Update Tool System (nuts) is not designed exclusively as a backup utility in the way other utilities like restic, bup, or filesystem-level tools like xfsdump and xfsrestore, btrfs-snapshot, or lvmcreate were.
  • A container, virtual machine, Live USB creator, Linux distribution, or desktop environment.
    • 🔰 Information: We don’t know why anyone would think that, but one can never know, so let’s clarify that.

Requirements

  • Nitrux 2.8.0+.
  • An active Internet connection.
  • There is up to 1.6 GB of available space in the root partition and more than 3.2 GB in the home partition.

Supported Releases

Nitrux Update Tool System (nuts) specifically targets version 2.8.0+.

However, Nitrux Update Tool System (nuts) can technically work with previous releases that use an immutable root, such as Nitrux 2.6.0, 2.6.1, 2.7.0, and 2.7.1, as long as the partition labels match the specific values (NX_ROOT for the root partition and NX_HOME for the home partition which is standard since Nitrux 2.8.0).

Download

Nitrux Update Tool System (nuts) is included by default, starting with Nitrux 2.9.0.

For releases of Nitrux where the Nitrux Update Tool System (nuts) is not available by default, do the following.

git clone --depth=1 https://github.com/Nitrux/nuts.git $HOME/nuts
sudo cp $HOME/nuts/usr/bin/nuts /usr/bin
sudo cp $HOME/nuts/etc/nuts.conf /etc

Usage

Nitrux Update Tool System (nuts) is designed to be highly autonomous.

  • 🔰 Information: Users can only interact with the program to update or restore the backup.
  • 🔰 Information: Log out or reboot the computer after updating or restoring the distribution using the Nitrux Update Tool System (nuts).

Commands:

sudo nuts update
  • Updates the currently installed root using the specified media in nuts-query and backs up the root directory.
sudo nuts restore
  • Restores the backup of the root directory generated during the update.

Configuration:

Nitrux Update Tool System (nuts) uses the file /etc/nuts.conf to load some settings.

Options:

sudo nuts -h
  • Displays the help of nuts.
sudo nuts -d
  • Runs nuts in verbose mode.
sudo nuts -v
  • Displays the version of nuts.

By the way, yes, the name is on purpose.