The Guix System
Linux Format|February 2022
Guix takes a novel approach to its package management. Mats Tage Axelsson guides you around it.
By Mats Tage Axelsson
When you first choose your distribution, it comes down to what’s available and what’s easy to use. As you learn more about Linux, you’ll start thinking more about how your choices affect your daily use. For many users, the choice of desktop and styling makes the biggest impression. Yet the real difference between distributions is how you manage packages.

The most common package manager is the Debian dpkg one. Ubuntu uses its own version of it, and only the repositories differ. Also, the way the system installs software is the same. Once you decide to install a software package, it goes to the standard position, all according to the Linux Software Base (LSB).

For Guix developers, this system had too many drawbacks, including dependency hell. In this hell, you have a favourite application that depends on library 1.x. All new applications use 2.0 of said library. In this case, the old application must go, or else all your new applications won’t work. Though this is rare for ordinary users, it’s an issue that plagues developers.

To solve this problem Guix developers, searched high and low but couldn’t find a decent solution to this problem. Until NixOS showed the way. They now had an excellent way to handle this problem, and a few others, but it was not GNU compliant and so the GNU Guix system was born.

Distro breakdown

There are two things that make up a distribution: the package manager, and the selection they offer by default. The package managers maintain the binaries or all source code. The default is to download binary packages and place them according to standard. The exceptions are Gentoo, Arch and a few others that default to compiling software.

Compared to those distros, Guix has made a decision to keep all binary files in one big directory called The Store. The designers of NixOS used this concept and the Guix developers re-used the code. It comes as GNU Guix, the package manager and GNU Guix System, the distribution.

If you need to use an odd version of a package then you can install the package manager on your current distribution. For developers, this is a great way to create a separate environment for each project. You also do not have to worry about an upgrade changing your development environment.

When you first install GNU Guix System, the distribution, you may not notice any difference. Since the install is a simple script, if you run a desktop environment and just regular applications then you can continue as normal. The installer itself is simple: it looks outdated and is a little unpolished, but gets the job done.

To see the real difference from other distributions, you need to look inside the file system. As mentioned before, all binaries are in The Store and libraries have links to it. This way of doing things also helps when you run an upgrade. If you need to roll back, Guix uses a “generation” of the older install. In order to roll back, simply reboot and choose the old generation. Ordinary distributions overwrite existing files and this makes it harder to roll back if an upgrade fails.

One quirk of running Guix System is that it uses GNU Shepherd as an init system, rather than the more commonplace Systemd. The init system starts your system and manages all the daemons in your computer. The Guix developers have many good reasons for using Shepherd, but most of these reasons are beyond the scope of this article. You’ll need to learn more about it when you want to create your own services and extensions. Extensions are one of the concepts that are a key feature of Shepherd.

Of greater importance is that Shepherd is a GNU project and so is the Guix project. To configure the Guix System, you use Guile, an implementation of the Scheme language. This is the official extension language of GNU projects. Knowing Scheme is useful, but it’s not essential. To configure your system, you can learn everything you need from the supplied examples.

From NixOS to GuixOS

Development on the Guix package manager began in 2013. During the first three years, the developers only upgraded the package manager and added packages. In March 2016, they released the first Guix SD version. They later renamed it the Guix System, which is now the official name of the distribution.

Initial work used NixOS for package handling, and much of the code still comes from there. It does use other configuration files because Guile is the main language. As work progressed, they also added new features for both the system and the package manager. A couple of interesting features that you can use are guix shell and guix pack. The shell command creates an environment in the current directory according to your files in that directory. The pack command creates a package that you can use elsewhere. You can create both a docker image and relocatable tarballs that others can use, irrespective of their distribution.

Guile is the Guix advantage

Continue reading your story on the app

Continue reading your story in the magazine

MORE STORIES FROM LINUX FORMATView All

Bluehost Web Hosting

Feature-packed hosting geared towards WordPress, discovers Mike Williams.

2 mins read
Linux Format
May 2022

Build a Python-based reaction game

Les Pounder goes back to the early days of the Raspberry Pi to look at a board that made a big difference to his career.

6 mins read
Linux Format
June 2022

BULLET-PROOF UBUNTU 22.04

Walpurgis Night is nearly upon us, so cast aside your old OS and begin life anew with Ubuntu 22.04

10+ mins read
Linux Format
June 2022

Armbian 22.02 Jammy XFCE

Les Pounder takes a look at a distro that supports 64 different Linux single board computers, and now he has to buy them all.

3 mins read
Linux Format
June 2022

ALL HANDS ON DECK

Jonni Bidwell pries Valve's Steam Deck from PC Gamer's cold, anthropomorphised hands and gets his game on.

10+ mins read
Linux Format
June 2022

Arducam Auto-focus 16MP Camera module

Quick-off-the-draw Les Pounder can't shoot shots faster than this camera.

3 mins read
Linux Format
June 2022

The Last Cube

Management isn't keen on sentient anything, it's bad for productivity, so Neil Mohr keeps the thinking to a minimum which isn't helping here at all...

3 mins read
Linux Format
June 2022

Ubuntu 22.04 LTS

If there's one thing Mayank Sharma likes even less than Ubuntu, it's Ubuntu LTS releases, which are notably stable but not notable generally.

6 mins read
Linux Format
June 2022

HostGator

A basic website hosing option for small and medium businesses that Shashank Sharma thinks should be on your short list.

3 mins read
Linux Format
June 2022

Linux Mint DE 5

Whenever there's a new LMDE release, Mayank Sharma can't help but think of the old adage: "It's the thought that counts.”

3 mins read
Linux Format
June 2022
RELATED STORIES

Valve Steam Deck: Powerful Handheld Gaming

A beefy but quirky portable gaming PC

10+ mins read
PC Magazine
April 2022

Use Inkscape Extensions to Create 3D Objects From Paper - Paper Tiger

Papercraft is coming back into fashion. Linux users can turn to Inkscape and plugins such as Boxes.py, Paperfold, and Tabgen to create templates from 3D objects for printing.

5 mins read
Linux Magazine
#258/May 2022: Clean IT

Machine Of The Month: The Commodore 64

You’ll need this vice (the versatile commodore emulator) Download from http://viceemu.sourceforge.net for your Windows or Linux PC.

5 mins read
Maximum PC
February 2020

Ready To Reinstall Windows? Here Are Your Options..

Ready to reinstall Windows? Are you really? Let’s look at your options...

10 mins read
Maximum PC
October 2019

How Windows And Chrome Quietly Made 2019 The Year Of Linux On The Desktop

Both Windows 10 and Chrome OS are embracing the Linux Kernel and the software that runs on it.

4 mins read
PCWorld
June 2019

End Of Smartphone Revolution? The Clone Wars

All of you must have noticed that smartphones nowadays all look and feel the same, provided they’re in a similar price range of course.

5 mins read
Exhibit
July 2021

Keeps Your Risk Factors Under Complete Control

Sartorius introduced the very first Sartocheck ® Filter Integrity Tester in 1980 and over a period spanning more than 3 decades, Sartocheck ® Filter Integrity Tester evolved into an extremely sophisticated automated integrity test solution which is preferred by customers across the globe.

4 mins read
Bio Spectrum
Decemeber 2019