LINUX · LPI LINUX ESSENTIALS · CHAPTER 1

Linux, Distributions and Repositories

Kernel, distributions, packages and repositories: the map to get started with Linux.

7 min readDomain 011 · Linux OS and Open Source SoftwareLevel: beginner

From point A to point B

Point A: you know Linux is behind almost every server, Android and the cloud, but you are not sure what it is exactly, why there are so many versions or how software gets installed on it. Point B: by the end of this chapter you will be able to explain what a distribution is, recognize the major families and understand how programs reach your machine from a repository.

This is the gateway to the whole path. Docker and Kubernetes run on Linux: the better you understand it, the easier everything that follows will be.

What Linux is and where it comes from

Strictly speaking, Linux is the kernel: the program that talks to the hardware and shares the CPU, memory and disks among processes. Linus Torvalds created it in 1991 as a personal project inspired by Unix, and version 1.0 arrived in 1994. Today thousands of people and companies around the world develop it, under the GPL version 2 license.

A kernel alone is not enough to get work done. You need tools: a command interpreter, utilities such as ls or cp, libraries, compilers. Many of them come from the GNU project, started by Richard Stallman in 1983. That is why you will also see the name GNU/Linux used for the complete system.

What a distribution is

A distribution (or "distro") is a complete operating system built on the Linux kernel: a selection of programs, a package manager, an installer and an update policy, created and maintained by a company or a community.

What a Linux distribution is made of The Linux kernel talks to the hardware. On top sit the GNU tools and libraries, the shell and a package manager, and then the applications. A distribution is the kernel plus a curated selection of everything above it, maintained by a company or a community. KERNEL + SOFTWARE = DISTRIBUTION Hardware · CPU, RAM, disks, network Linux kernel GNU toolsls, cp, grep… Shellbash, zsh Package managerapt, dnf, zypper Applicationsdesktop, web server, database, your code DISTRIBUTIONDebian, Ubuntu,Fedora, openSUSE… a company or a community chooses, tests and maintains this whole stack

The kernel is shared; what changes from one distribution to another is everything on top of it. Diagram: The House of Routing.

The major families

Almost every distribution descends from a few roots. Knowing which family a distribution belongs to tells you which package format it uses and which commands manage it.

Main Linux distribution families Debian family uses .deb packages with dpkg and apt: Debian, Ubuntu, Linux Mint, Kali, Raspberry Pi OS. Enterprise Linux family uses .rpm packages with rpm and dnf: Red Hat Enterprise Linux, Fedora, CentOS Stream, Rocky Linux, AlmaLinux. SUSE family uses .rpm with zypper: SUSE Linux Enterprise, openSUSE. Others include Arch with pacman and Alpine with apk. DISTRIBUTION FAMILIES Debian family .deb · dpkg · apt DebianUbuntuLinux MintKali LinuxRaspberry Pi OS Enterprise Linux .rpm · rpm · dnf Red Hat Enterprise LinuxFedoraCentOS StreamRocky LinuxAlmaLinux SUSE family .rpm · zypper SUSE Linux EnterpriseopenSUSE LeapopenSUSE Tumbleweed Others pacman · apk Arch LinuxManjaroAlpine Linux(very common incontainer images)

Each family has its own package format and tools. Diagram: The House of Routing.

  • Debian family: .deb packages, dpkg and apt tools. Ubuntu is the most widely used on servers and in the cloud; its LTS (Long Term Support) releases are supported for years.
  • Enterprise Linux family: .rpm packages, rpm and dnf tools (successor to yum). Red Hat Enterprise Linux is the enterprise benchmark; Rocky Linux and AlmaLinux are compatible, free alternatives.
  • SUSE family: also uses .rpm, but with its own tool, zypper.
  • Others: Arch Linux (with pacman) and Alpine Linux (with apk), very popular as a base for container images because of its minimal size.
Update your map. Some classic names are no longer maintained: CentOS Linux reached end of life in 2024 (CentOS Stream continues) and Scientific Linux was discontinued too. Version 2.0 of the Linux Essentials exam already organizes distributions by family, as in this diagram.

Linux where you do not see it

Because the kernel is modular and its license allows you to adapt it, Linux runs in places that do not look like computers:

  • Embedded systems: systems tailored to a specific task. Android uses the Linux kernel and runs on phones, TVs, cars and watches. Raspberry Pi OS turns a low-cost board into a server, a home automation hub or an IoT device.
  • The cloud: the vast majority of virtual machines on AWS, Google Cloud and Azure run Linux, and the providers publish their own optimized distributions.
  • Virtualization and containers: KVM turns the kernel itself into a hypervisor, and kernel features (namespaces and cgroups) are the foundation of the containers you will see in the Docker topic.

Installing software: source code or packages

There are two ways to install a program on Linux:

  • From source code: you download the code and compile it on your machine, traditionally with ./configure, make and make install. It gives you full control, but you handle dependencies and updates yourself.
  • With packages: software already compiled for your architecture (x86_64, ARM…) and ready to install. The package manager resolves dependencies, records what it installed and makes updating or uninstalling easy. This is the usual way.
# Debian / Ubuntu family
sudo apt update              # refreshes the package index
sudo apt install nginx       # installs with dependencies
sudo apt remove nginx        # uninstalls
dpkg -l | grep nginx         # queries installed packages

# Enterprise Linux family (Fedora, RHEL, Rocky, Alma)
sudo dnf install nginx
rpm -qa | grep nginx

dpkg and rpm work with a specific package file; apt and dnf sit one level above: they search the repositories and resolve dependencies for you.

Repositories: where packages come from

A repository is a server (usually replicated across many mirrors around the world) that publishes a list of packages available for your distribution. Your system keeps the list of repositories it uses and, with apt update, downloads their updated index.

How packages arrive from a repository The system reads its list of sources, apt update downloads the package index from the repository mirrors, and apt install downloads the package with its dependencies and installs it. SOURCES → INDEX → PACKAGE Repositorymirrors worldwidemain · universe… apt updaterefreshes the index apt install nginxpackage + dependencies Your systemnginx installed sources: /etc/apt/sources.list · /etc/apt/sources.list.d/*.sources

First the index is refreshed; then the package is installed along with its dependencies. Diagram: The House of Routing.

Components or sections

Each repository is split into sections by license and support, and each distribution names them differently:

DistributionSectionsWhat they contain
Debianmain · contrib · non-free · non-free-firmwareFree software · free software that depends on non-free · non-free · non-free firmware
Ubuntumain · restricted · universe · multiverseSupported by Canonical · proprietary drivers · community maintained · with legal or licensing restrictions

Where they are configured

The classic format is one line per repository in /etc/apt/sources.list:

# type   URI                              release   components
deb      http://deb.debian.org/debian     trixie    main contrib non-free non-free-firmware

Recent releases (Ubuntu since 24.04, and increasingly Debian) use the deb822 format, with one file per source inside /etc/apt/sources.list.d/:

cat /etc/apt/sources.list.d/ubuntu.sources
# Types: deb
# URIs: http://archive.ubuntu.com/ubuntu/
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
Security first. Add only official repositories or ones from vendors you trust. A repository can install software with administrator privileges on your machine; that is why each one is signed with a key your system verifies.

Lab: your first Linux machine

To follow the path you need a Linux system to practice on. Pick the option that suits you best:

  • Virtual machine: install VirtualBox or VMware Workstation and create a VM with Ubuntu Server LTS or Debian. It is the safest option: if something breaks, you delete it and start over.
  • WSL on Windows: run wsl --install in PowerShell as administrator and you will have Ubuntu inside Windows in minutes.
  • Dual boot or USB: create an installation USB drive with a tool such as Rufus or balenaEtcher. If you are going to resize the Windows partition, back up your data first.
  • A cloud instance: the free tiers of AWS, Google Cloud or Azure give you a Linux VM you can reach over SSH.

Once you have it, run this:

cat /etc/os-release          # which distribution and version you have
uname -r                     # kernel version
ls /etc/apt/sources.list /etc/apt/sources.list.d/   # your repositories (Debian family)
sudo apt update && sudo apt upgrade -y               # bring the system up to date

Linux Essentials-style challenge

Answer before you open the solution. Getting it wrong here is the cheapest way to learn.

1. Strictly speaking, what is Linux?

The operating system kernel. The complete system, with GNU tools and applications, is a distribution.

2. A server uses .rpm packages and the dnf command. Which family does it belong to?

The Enterprise Linux family (Red Hat, Fedora, Rocky, Alma). SUSE also uses .rpm, but it is managed with zypper.

3. What is apt update for if it does not install anything?

It downloads the updated index from the repositories. Without it, apt install would work with an outdated list of versions and dependencies.

4. Android and Raspberry Pi OS are examples of…

Linux-based systems for specific devices, the realm of embedded systems: the kernel is adapted to a particular piece of hardware and a particular mission.

What you take away

  • Linux is the kernel; a distribution is the kernel plus all the software around it.
  • Three major families: Debian (.deb, apt), Enterprise Linux (.rpm, dnf) and SUSE (.rpm, zypper).
  • Linux dominates servers, the cloud, containers and embedded devices.
  • Packages come from repositories; apt update refreshes the index and apt install installs.
  • Use only trusted repositories: installing software means giving it access to your system.

In the next chapter you meet the community that makes all of this possible: the most widely used applications, open source licenses and how people work with Linux day to day.

Official resources

Source and credits. Chapter written from Jesús Espinoza's study notes for the LPI Linux Essentials certification (2022), updated to version 2.0 of the exam (010-200). Text drafted with AI assistance; original diagrams by The House of Routing. Technical details were checked against the official documentation from LPI, GNU and the distributions.

Navigate