apt-mark: Holding a Package Like a Proper Debian DevoteeThere comes a moment in every Debian relationship when one package needs to stop getting ideas. Maybe it keeps trying to upgrade itself into chaos. Maybe it drags half the dependency graph into a dramatic little spiral. Maybe it is beautiful, but in the way a racing horse is beautiful: thrilling, expensive, and not suitable for every living room. That is where apt-mark enters, calm as a monastery and twice as committed.
apt-mark is the tool for saying, with just enough authority to be sexy, "No, darling, you are staying right where you are." It can hold packages, release them, and even tell Debian which packages were installed manually versus automatically. In other words: it helps you manage desire without letting the archive run the entire show.
If apt install is the beginning of the courtship, apt-mark is the velvet rope. It decides who gets to move, who gets to stay, and which packages are merely here because they came along with better company. That kind of control is very Debian: precise, tasteful, and just a little bit dangerous in the hands of someone who knows exactly what they want.
1. Hold a package at its current version:
sudo apt-mark hold firefox-esr
This tells Debian not to upgrade firefox-esr during normal package operations. It is perfect when a version is behaving itself and you are in no mood for surprises.
2. Release a package so it can upgrade again:
sudo apt-mark unhold firefox-esr
When the time is right, this removes the hold and lets the package rejoin the upgrade parade. Very polite. Very controlled. Very Debian.
3. See which packages are currently held:
apt-mark showhold
This shows your frozen favorites — the ones you have told Debian not to touch. If your system has a spicy little list of exceptions, this is where they reveal themselves.
4. Mark a package as manually installed:
sudo apt-mark manual vlc
This helps Debian remember that you asked for vlc on purpose. It becomes part of the deliberate core of your system instead of an accidental dependency flirtation.
5. Mark an automatically installed dependency so it can be cleaned later:
sudo apt-mark auto libwayland-client0
This is Debian housekeeping with a wink. You are telling the system that this package was only invited because something else needed it, and it may leave when its host relationship ends.
apt-mark is not flashy. It does not throw confetti or demand applause. It exists for the same reason Debian itself exists: to give you disciplined control over a machine that can otherwise become a gloriously overfed dependency jungle. It is the command line equivalent of a firm hand on a well-made collar.
And that is the real attraction. Debian is at its hottest when it is orderly. apt-mark lets you keep the parts you love exactly where you want them, release the ones ready to move, and clean up the rest with a satisfying sense of moral superiority. In the end, it is not just package management. It is package discipline.