Auditing What's Actually Installed
This final chapter pulls together every command from the previous nine into a small set of habits genuinely worth running periodically — on Philip's actual Debian server and Raspberry Pi, and on any RPM-based system encountered along the way.
Auditing What's Actually Installed
$ apt list --installed
$ # dnf — equivalent
$ dnf list installed
$ # Manually installed packages only — excludes anything pulled in purely as a dependency
$ apt-mark showmanual
apt-mark showmanual is genuinely useful for understanding what you actually chose to install over time, versus the much larger set of dependencies pulled in automatically alongside those choices — a clearer picture of a system's real, deliberate software footprint.
Finding and Removing What's No Longer Needed
$ sudo apt autoremove
$ sudo dnf autoremove
$ # Clear cached .deb/.rpm files no longer needed after install
$ sudo apt clean
$ sudo dnf clean all
autoremove removes orphaned packages that are no longer needed at all. clean removes cached download files (the .deb files themselves, already installed, sitting in /var/cache/apt/archives/) that served their purpose and are just consuming disk space now. Running both periodically keeps a system genuinely lean rather than slowly accumulating cruft.
A Safe, Repeatable Update Routine
$ sudo apt update
$ sudo apt upgrade
$ sudo apt autoremove
$ sudo apt clean
Unattended Security Updates — Worth Knowing About, Even If Not Always Used
$ sudo dpkg-reconfigure unattended-upgrades
Configures security updates to apply automatically, without manual intervention — a real trade-off between staying patched against known vulnerabilities promptly versus the small risk of an automatic update introducing an unexpected problem on a system you weren't actively watching at the time.
apt upgrade is low-risk; a full distribution upgrade between major releases is a genuinely bigger event — back up critical data first, read the release notes for known breaking changes, and consider testing on a non-critical system or VM before applying it to something like a production server.
A Final, Complete Maintenance Checklist
Chapter 10 Quick Reference — and Course Wrap-Up
- apt list --installed / dnf list installed — full installed-package audit
- apt-mark showmanual — what you actually chose to install, excluding auto-pulled dependencies
- autoremove — removes orphaned packages; clean — removes cached download files; genuinely different, often run together
- Sensible routine: update → upgrade → autoremove → clean, run periodically
- unattended-upgrades — automates security patching, a real convenience-vs-control trade-off
- Major version upgrades deserve more caution than routine upgrades — back up, read release notes, test first
- Course recap: concepts (Ch1) → APT (Ch2) → Debian repos (Ch3) → dpkg (Ch4) → RPM/dnf (Ch5) → RedHat repos (Ch6) → rpm (Ch7) → troubleshooting (Ch8) → snap/flatpak/pacman (Ch9) → maintenance workflows (Ch10)
- The throughline across both families: a friendly front end (apt/dnf) for dependency-aware everyday use, a low-level engine (dpkg/rpm) underneath for direct inspection and repair