Sub topic 2
Two Lineages: Debian-Based and RHEL-Compatible
Prerequisites and the main idea
This chapter assumes that you are comfortable using a Linux shell, installing packages, working with systemd services, and using basic firewall and permission concepts.
A Linux distribution combines the Linux kernel with system tools, libraries, installers, package repositories, and default configuration. Ubuntu Server, Debian, and Rocky Linux all run Linux, but they come from different distribution lineages. A lineage is a family of distributions that shares package formats, management tools, and many administration conventions.
Ubuntu Server is based on Debian. Rocky Linux follows the Red Hat Enterprise Linux (RHEL) family. These relationships affect the commands you use, the location and naming of packages, the security defaults, and the software documentation that applies to a server.
Debian-based systems
Debian is the upstream project for the Debian lineage. Ubuntu takes Debian packages and adds its own release process, patches, tools, and commercial ecosystem. Linux Mint and several other distributions also use this lineage.
Debian-based systems generally use:
.debpackages.dpkgas the low-level package installation tool.aptas the higher-level package manager.apt install,apt remove, andapt upgradefor common administration.- Ubuntu-specific documentation when the host runs Ubuntu.
apt resolves dependencies, which are other packages required by the package you install. It downloads packages from configured repositories and records the installed package database through dpkg.
The lineage does not make every Debian-based distribution identical. Ubuntu may carry a newer kernel, different defaults, or a package version that Debian stable does not provide. Always check the distribution and release before applying instructions.
RHEL-compatible systems
RHEL is Red Hat's enterprise Linux distribution. Rocky Linux is built to be compatible with RHEL, so software built for the RHEL family will usually use the same package format and administration patterns. AlmaLinux and Oracle Linux are other examples in this family.
RHEL-compatible systems generally use:
.rpmpackages.rpmas the low-level package tool.dnfas the higher-level package manager.dnf install,dnf remove, anddnf upgradefor common administration.- SELinux and firewalld as important parts of the default server model.
dnf also resolves dependencies and obtains packages from repositories. A package may have a different name from its Debian counterpart. For example, a library package might end in -devel on a RHEL-compatible system but use -dev on a Debian-based system.
| Administration task | Debian-based system | RHEL-compatible system |
|---|---|---|
| Install a package | `sudo apt install nginx` | `sudo dnf install nginx` |
| Find package details | `apt policy nginx` | `dnf info nginx` |
| List installed packages | `dpkg -l` | `rpm -qa` |
| Package file format | `.deb` | `.rpm` |
| Common repository directory | `/etc/apt/sources.list.d/` | `/etc/yum.repos.d/` |
Identify the lineage before changing a server
Do not infer the distribution from the shell prompt or from one installed command. Read /etc/os-release, a standard file containing operating system identification fields.
#!/usr/bin/env bash
set -eu
. /etc/os-release
printf 'Name: %s\n' "$NAME"
printf 'Version: %s\n' "$VERSION_ID"
printf 'ID: %s\n' "$ID"
printf 'Family: %s\n' "${ID_LIKE:-not specified}"
case "$ID" in
debian|ubuntu)
echo "Use Debian-family documentation and apt-based instructions."
;;
rocky|rhel|almalinux|fedora)
echo "Use RHEL-family documentation and dnf-based instructions."
;;
*)
echo "Check the distribution documentation before proceeding."
;;
esacThe ID field identifies the specific distribution. ID_LIKE, when present, indicates a related family. A missing ID_LIKE value is not an error. The exact ID and release version are still important.
Shared foundations and important differences
Both lineages commonly use systemd, OpenSSH, standard Unix permissions, and similar filesystem layouts. A systemd command such as systemctl status nginx is often portable.
The surrounding configuration is less portable. Repository files, package names, firewall front ends, mandatory access control, and service defaults can differ. AppArmor is common on Ubuntu and Debian. SELinux is common, and usually enforcing by default, on Rocky Linux and other RHEL-family systems.
The diagram shows the broad relationship:
Choose instructions by family, then verify them against the exact release. This habit prevents many avoidable administration errors.
Exercise
A server reports ID=rocky in /etc/os-release. Which package manager and package format should you expect, and which command would install nginx?
Show answer
Expect dnf and RPM packages. Run sudo dnf install nginx, after confirming that the configured repositories are appropriate for the server.