1 of 7

distri: a Linux distribution to research fast package management

Michael Stapelberg�@zekjur

CCCamp2019

2 of 7

package manager speed: install ack

rate = data ÷ wall-clock time�note that systems have different packages in base

distribution

package manager

data

wall-clock time

rate

Fedora

dnf

98 MB

25s

3.92 MBps

NixOS

Nix

15 MB

12s

1.25 MBps

Debian

apt

16 MB

10s

1.6 MBps

Arch Linux

pacman

6.4 MB

1s

6.4 MBps

Alpine

apk

41 MB

0.5s

82 MBps

3 of 7

distri installation speed

4 of 7

key idea: packages are images

  • use an image format (e.g. SquashFS) instead of an archive format (e.g. tar)�
  • no unpacking needed�→ install is just downloading a file and mounting it�→ can saturate even fast network links (tested with 100 Gbps)�→ sub-second package build env setup in namespace�
  • package installation (adding to the package store) is atomic!

5 of 7

key idea: separate hierarchies

  • mount each image under its own path (“separate hierarchies”):�e.g. /ro/nginx-amd64-1.14.1-3/…�e.g. /ro/zsh-amd64-5.6.2-7/…�
  • all packages are co-installable, no conflicts�→ no dependency resolution required at install time�
  • (rest of the system as usual, i.e. /etc, /var/cache, …)

6 of 7

key idea: exchange directories

  • packages exchange data via directories with well-known paths, e.g.:�man(1)nginx(1) via /usr/share/mangcc(1)libusb(3) via /usr/include
  • prudent approach: emulate well-known paths �e.g.:�/usr/include/jpeglib.h is a symlink to /ro/libjpeg-turbo-amd64-2.0.0-3/out/include/jpeglib.h�
  • compatible with third-party software or sources

7 of 7

distri: about the project

  • don’t use it for anything but research
  • try it out! in qemu, USB stick, virtualbox, docker or google cloud�
  • talk to me any time!