Repositories
Cheat sheet · https://pcornel.dk/topic.php?topic=2740
Answer
APT repositories are sources of packages defined in /etc/apt/sources.list or .sources/.list files in /etc/apt/sources.list.d/, each with a URI, suite (e.g. noble, bookworm) and components, signed by a key.
Remember
Use the release codename that matches the system (. /etc/os-release; echo $VERSION_CODENAME). Keys belong in /etc/apt/keyrings with signed-by= — apt-key is deprecated. Pin priorities in /etc/apt/preferences.d control which repo wins.
First checks
apt policy <pkg> / dnf info <pkg>— installed and candidate versionsdpkg -l <pkg> / rpm -q <pkg>— installed packageapt-cache depends <pkg> / dnf repoquery --requires <pkg>— dependenciesdpkg -S <file> / rpm -qf <file>— package owning a file
Commands
curl -fsSL https://repo.example.com/key.asc -o /etc/apt/keyrings/example.asc
Verify in this order
repository defined → indexes downloaded and signature verified → packages available with priorities
Where it usually breaks
First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2740