debian
Debian-specific material
-
apt
Search, install, remove and upgrade packages with apt, including how to see what it will do before it does it, and which commands are safe in a script.
-
apt-cache
Search the package cache, read a package's record, follow its dependencies, and use policy to see which version apt would install and from where.
-
apt-file
Tested apt-file examples: searching Debian's file index for a command you have not installed, and the substring trap in a plain pattern.
-
dpkg
Query what's installed, find which package owns a file, inspect a .deb before trusting it, and repair a half-finished install: the layer beneath apt.
-
getent
Tested getent examples: passwd, group, hosts and shadow through NSS, the exit status a script reads, and the members a group listing leaves out.
-
adduser, useradd and friends
Tested examples for adduser, useradd, usermod, deluser and the group commands: why Debian ships two of each, and the -aG that silently drops every other group.
-
sudo
Tested sudo and su examples: running one command as root, what the environment loses on the way, the redirect that still runs as you, and reading sudoers.
-
which
Tested which examples: how PATH order decides the answer, the shell script Debian ships in place of the GNU program, and the deprecation that was reversed.
-
Where things live on a Debian system
Why configuration is in /etc, why /usr belongs to apt, what /var accumulates, and which two directories the package manager will never touch.
-
apt update failed
apt update reports a failure, exits 0 and carries on with an index fetched days ago. How to read the transcript and find the repository that broke.
-
Could not get lock /var/lib/dpkg/lock-frontend
apt refuses to run because something else is already installing. Modern apt tells you exactly which process, and deleting the lock file is the wrong fix.
-
Package installation failed
apt install stops before dpkg runs. Telling a package apt has never heard of from one it cannot download, and why --fix-missing is rarely the answer.
-
The following packages have been kept back
apt-get upgrade refuses to install new packages, so an upgrade that needs one is held back instead. What the message means and the three things that cause it.
-
The repository does not have a Release file
apt asked a repository for dists/<suite>/Release and got a 404. Telling an archived release from a typo and from a flat repository, and what each one needs.
-
The repository is not signed
apt cannot verify a repository's signature: the NO_PUBKEY and Missing key errors. What Debian 13 changed, and why apt-key adv is no longer the fix.
-
sudo: command not found
On Debian, sudo is often simply not installed, and your user is not in the sudo group. Why the installer does that, and how to fix it from a root shell.
-
Unmet dependencies
apt refuses to install and lists unmet dependencies. The three ways it words them, what each rules out, and finding the hold or conflict behind the refusal.
-
apt upgrade vs full-upgrade vs dist-upgrade
apt-get upgrade installs nothing new, apt upgrade installs but never removes, and full-upgrade does both. dist-upgrade is the same command under an older name.
-
apt vs apt-get
The same package ships both, and they do the same job. What differs is who each is written for, and only one of them is safe in a script.
-
cron vs systemd timers
Debian ships both and uses both. What differs is where the output goes, what happens to a missed run, and whether you can test the schedule.
-
remove vs purge vs autoremove
Not three strengths of one operation. Two of them differ over configuration files; the third acts only on packages you never asked for.
-
sh vs bash vs dash
On Debian /bin/sh is dash, not bash. That one fact explains most scripts that work at your prompt and fail the moment something else runs them.
-
ss vs netstat
netstat is not installed on a Debian system and ss is. The flag translations, the filter syntax netstat cannot express, and when the old name is still fine.
-
su vs sudo -i vs sudo -s
sudo -i, sudo -s, su and su - leave you as root with different directories and audit trails. Which to type, and why su fails on a stock Debian install.