logo

Linux

Last Updated: 2023-02-14

These set of notes are Linux specific, check out OS page for general OS notes.

TL;DR

What is a Linux distro?

Linux distro = Linux Kernel
               + (GNU) tools and libraries
               + desktop environment
               + package manager
               + other software

How to choose a Linux distro?

  • if you are new to Linux, or use Linux as your desktop, choose Ubuntu or its popular user friendly derivatives.
  • if you are working on Linux servers, get familiar with Debian and/or RedHat (CentOS used to be popular on servers, but things changed.)
  • if you are a hardcore Linux user, or simply want to learn more, choose a more customizable distro: Arch, Gentoo or Slackware.
  • if you have specific use cases, search for the best option for the job: if you are working on security and doing Penetration Testing, choose Kali; if you want to deploy applications in container / cloud, choose a small distro like Alpine.
  • for compliance, double check the requirements. (e.g. Ubuntu cannot be used in some cases in the US because the company, Canonical, is not based in the US.)

Linux Distros Differences

Kernel

The word "Linux" actually refers to the Linux Kernel. That is why sometimes you may see the term GNU/Linux: GNU provides tools on top of the kernel.

Linux distros all use Linux kernel, though the versions may be different. The Linux kernel community promised that no upgrade will ever break anything that is currently working in a previous release.

Source code: https://github.com/torvalds/linux

Components

  • tools and libraries
    • C standard library: e.g. glibc, musl, etc. Read More: Standard Libraries
    • Utilities:
      • coreutils (GNU)
      • BusyBox: a software suite that provides several Unix utilities in a single executable file, created for embedded operating systems with very limited resources. GPLv2
      • Toybox: a 0BSD licensed BusyBox alternative, used in AOSP
  • desktop environment: GNOME, KDE, XFCE, etc
  • package manager:
    • APT / dpkg: Debian and derivatives.
    • RPM: Redhat and derivatives.
    • pacman: Arch and derivatives.
    • postage: Gentoo and derivatives. (e.g. ChromeOS)
  • init systems
    • systemd: most major distros use this
    • OpenRC is the default init system of Gentoo, Alpine Linux
  • Supported chips / architecture: x86, x86_64, ARM, etc.

Release Schedules

Some distros do rolling releases while others only release stable versions every a few years. Some distros do both, e.g. Debian has Debian stable and Debian testing.

Notable Linux Distros

Debian / Ubuntu

  • Ubuntu is derived from Debian. LTS (Long term support, supported for 5 years) versions every 2 years. Ubuntu is a very popular Desktop Linux.
  • use dkpg / apt as package manager.
  • many Debian / Ubuntu derivatives:
    • MX Linux: based on Debian stable.
    • Linux Mint: based on Ubuntu.
    • Pop!_OS: based on Ubuntu, by System76. System76 is building a new desktop environment in Rust: "There are things we'd like to do that we can't simply achieve through extensions in GNOME".
    • Elementary OS: based on Ubuntu.
    • Zorin: based on Ubuntu, Windows-like.
    • Kali: based on Debian, security oriented.
    • Raspberry Pi OS: 64-bit available since 2022.
    • gLinux: Google internal, based on Debian; not publicly available.

RedHat / CentOS / Fedora

  • RHEL (Red Hat Enterprise Linux) as the name suggests, is primarily for enterprise use.
  • CentOS was the open source version; discontinued in 2020; CentOS Stream is NOT a replacement of CentOS, but will be a rolling preview of what's next in RHEL.
    • CentOS clones after this change:
      • Rocky Linux (parent: CIQ).
      • AlmaLinux
  • Fedora is the community version. Each release is supported for 13 months; unlike Ubuntu, it does not provide Long Term Support.
  • Amazon Linux: Based on Fedora, major release every 2 years, with 5 years of support and quarterly minor release updates. https://aws.amazon.com/linux/amazon-linux-2022
  • use yum as package manager.

Arch Linux

Can be fully customized.

Derivatives:

  • SteamOS: 1.0 and 2.0 were based on the Debian, 3.0 is changed to be based on Arch Linux. (Because Debian is more for servers, and has release cycles; Arch uses a rolling update, which is prefered by Valve for Steam Deck)
  • Manjaro: baesd on Arch but much easier to use. Manjaro is Arch-based but it isn’t Arch Linux.
  • EndeavourOS: lightweight and ships with a minimum amount of preinstalled apps. Since 2019. As close to plain-vanilla Arch as you can get, without hand-assembling Arch Linux the hard way.
  • Garuda: performance oriented.

Gentoo / ChromeOS

  • Gentoo: source-code-based. Named after the fast-swimming gentoo penguin, to reflect the potential speed improvements.
  • ChromeOS: originally based on Debian, but later moved to Gentoo.

Alpine Linux

https://alpinelinux.org/

Small, simple and secure. Often used for containers in clouds.

Using musl, BusyBox.

Slackware

Slackware is the oldest distribution that is still maintained (created in 1993). Highly customizable. The first vesions of SUSE was based on Slackware.

Android

Yes Android is also based on Linux; however Google's new OS, Fuchsia, is not based on Linux, but a microkernel called Zircon.

Read more on Android

GoboLinux

https://gobolinux.org/

Different file hierachy: each program gets its own directory tree.

Clear Linux

https://clearlinux.org/

Optimized for Intel's microprocessors with an emphasis on performance and security. Rolling release.

gLinux

Google's internal distro.

The first version was named Goobuntu, which was based on Ubuntu.

In 2018, Google moved from the Goobuntu to gLinux, which was based on Debian testing, with rolling releases, to avoid the 2-year release cycles.

For corp machines (directly used by developers to write and test code) only, not for prod (where the services like Google Search runs).

Linux-libre

A modified version of the Linux kernel that contains no binary blobs, obfuscated code, or code under proprietary licenses.

License: GPL v2.

Recent / future developments

eBPF

eBPF: a handy way to build firewalls.

Microsoft chose to port eBPF into Windows rather than try to duplicate its functionality with its own program.

io_uring

io_uring allows Linux to launch an operation asynchronously and wait for its completion. (predecessor: asynchronous I/O (AIO) subsystem)

io_uring uses a memory ring buffer shared between user space and the Linux kernel. This enables it to submit operations and collect the results without needing time-expensive Linux kernel calls. Its API is complex, but if your applications require lots of I/O, you get rewarded with vastly improved increased performance.

cgroup v2

Read more: namespaces

systemd

The init system. Read more: systemd