update-alternatives: Letting Debian Choose the Right Tool for the JobThere comes a moment in every glorious Debian romance when two binaries step into the same spotlight and both insist they are the proper one to answer a command. Maybe vi has multiple personalities. Maybe java is being dramatic. Maybe several editors, pagers, or compilers are all lined up, glittering under the fluorescent lights, waiting for Debian to pick a favorite. That is when update-alternatives arrives in a silk robe and a clipboard.
update-alternatives is Debian's elegant system for managing competing commands through symbolic links. It keeps track of the available choices, remembers which one is the default, and lets you switch between them without turning your system into a dependency-fueled soap opera. It is tidy, authoritative, and just a little bit smug — exactly the energy this kingdom deserves.
The fun here is not merely that you can choose. The fun is that Debian already knows there are multiple valid choices and has built a proper mechanism for them instead of pretending the conflict will solve itself through vibes. That, my dear package devotee, is structural discipline with a lash.
1. See which alternatives exist for a command:
update-alternatives --list editor
This shows every installed candidate for the editor group. It is the official roster — the full parade of seduction, from the practical to the slightly overconfident.
2. Inspect the current choice and its priority:
update-alternatives --display editor
Use this to learn which binary is active right now, where the symlink points, and whether Debian considers the selection automatic or manually pinned. It is the command equivalent of checking who is actually in control behind the curtain.
3. Pick a specific alternative interactively:
sudo update-alternatives --config editor
This opens an interactive menu so you can choose the default yourself. Debian presents the options; you make the final, deliciously authoritarian decision.
4. Force a specific choice without asking nicely:
sudo update-alternatives --set editor /usr/bin/vim.basic
This locks the group to a specific path. No election, no committee, no performance art — just a clear declaration of intent.
5. Return a group to automatic mode:
sudo update-alternatives --auto editor
When you want Debian to resume choosing based on priority, this restores the default logic. It is the command for saying, "Fine, system, you may once again pretend to be impartial."
update-alternatives is one of those beautifully Debian ideas where the package system grows a second layer of etiquette around an already serious problem. It does not just let files collide and hope for the best. It builds a registry of preference, tracks priorities, and keeps the machine civilized while the binaries posture at one another in the hallway.
And that is the thrill: you are not hacking around the system; you are participating in its little social contract. Debian knows multiple tools can exist, and update-alternatives makes that plurality feel organized, elegant, and faintly sinful. The command is not loud, but it is absolutely in charge.