Linux Distributions — Ubuntu and Debian
You are given SSH access to web1 and asked to install a web server on it. Before typing a single install command you need to know one thing: which kind of Linux is this? The answer decides every package command you type for the rest of the day.
The rule
Same kernel, different families; the package manager tells you which.
Linux is strictly just the kernel: the core that talks to hardware, runs processes and manages memory. A distribution (distro) wraps that kernel with everything else: a package manager, an init system, default configuration, a release schedule and a support promise.
Distros group into families that share a package format and tools. The Debian family is the one you will meet most on cloud servers:
- Debian: community-run, conservative, famously stable.
- Ubuntu: built on Debian by Canonical, with a predictable schedule. Its LTS (long-term support) releases come every two years and get years of security updates, which is why servers run them.
Both use .deb packages and the apt tool:
sudo apt update # refresh the list of available packages
sudo apt install nginx # install a package and its dependencies
sudo apt upgrade # install newer versions of what you already have
apt list --installed | grep nginxapt update downloads nothing but the catalogue. Forgetting it is why an install sometimes fails with "unable to locate package" on a fresh server.
The shortcut
Read /etc/os-release first. Every modern distro has it, and two lines settle the family:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="24.04 LTS (Noble Numbat)"
ID=ubuntu
ID_LIKE=debianID is the distro, ID_LIKE is its family. ID_LIKE=debian means apt commands will work.
Identify
cat /etc/os-releaseonweb1showsID=ubuntuandID_LIKE=debian.
The trap is copying install commands from a tutorial written for another family. The syntax looks plausible and simply fails, or worse, you install a differently named package.
Drills
Answer fast — trust the rule.
What does sudo apt update do?
Which file quickly tells you the distribution and its family?
Ubuntu is built on which distribution?
Why do servers usually run an Ubuntu LTS release?
Remember
- Same kernel, different families; the package manager tells you which.
- Shortcut: read
IDandID_LIKEin/etc/os-releasebefore installing anything. - Trap: running a tutorial's commands for the wrong family, or skipping
apt update.
