Stop Letting apt autoremove Surprise You: Practical apt-mark for Debian and Ubuntu apt autoremove is useful, but a lot of Linux admins treat it a little like a haunted button. You know it is supposed to remove packages that were installed only as dependencies and are no longer needed. But after enough package churn, desktop experiments, and one-off installs, it becomes easy to wonder: Why is APT trying to remove that package? Why is this dependency still hanging around? How do I keep a package I care about from getting swept up later? The answer is usually not guesswork. It is apt-mark . This article is a practical guide to the package state APT uses behind the scenes, how manual and auto marks affect autoremove , and a safe workflow for cleanup. What apt-mark actually controls When you explicitly install a package, APT marks it as manually installed . When APT installs extra packages only to satisfy dependencies, it marks those as automatically installed .…