By alternatives I mean (for the most part; see exception below) the roles corresponding to the files under /var/lib/dpkg/alternatives.  These roles includeawkdesktop-backgroundeditorglobal-assembly-cache-toolhaskell-compilerinfobrowserjavawwww-browserx-window-managerzshamong many others.The one exception I have in mind is the role display-manager (aka login-manager), which, AFAICT, is not represented under /var/lib/dpkg/alternatives, but I'm very much interested in.Given one of these roles, let's call it foo, I want to know all the available1 packages that can play foo, or, said more precisely, that provide an executable that can play foo.Of course, I want to know both the package and the path to the relevant executable, since the latter is not always obvious from the former; e.g. for the role x-window-manager, one such package is fluxbox, while the relevant executable is /usr/bin/startfluxbox, and not /usr/bin/fluxbox.(At least for the roles under /var/lib/dpkg/alternatives, packages providing such roles must be packaged in such a way that the alternatives manager can properly recognize them; that's my understanding, anyway.  If so, I'm hoping that there is some automatic way to identify all the packages that provide a particular role.)1 Available, that is, through the sources specified in my /etc/apt/sources* config.
How to find all the available packages (and executables) that can fulfill an alternative?
debian;apt;dpkg;alternatives
Virtual packages and the Debian alternatives system (which is where binaries come into play) are related but not the same. For packages, you can use apt-cache to find which (real) packages provide it:$ apt-cache showpkg awkPackage: awkVersions: Reverse Depends:   base-files,awk  base-files,awkDependencies: Provides: Reverse Provides: mawk:i386 1.3.3-17ubuntu2gawk:i386 1:4.0.1+dfsg-2.1ubuntu2original-awk 2012-12-20-1mawk 1.3.3-17ubuntu2gawk 1:4.0.1+dfsg-2.1ubuntu2For display managers, the virtual package is x-display-manager:$ apt-cache showpkg x-display-managerPackage: x-display-managerVersions: Reverse Depends:   utf8-migration-tool,x-display-manager  razorqt,x-display-manager  lxde,x-display-manager  numlockx,x-display-manager  ltsp-client-core,x-display-managerDependencies: Provides: Reverse Provides: gdm 3.10.0.1-0ubuntu3.1lightdm 1.10.6-0ubuntu1kdm 4:4.11.11-0ubuntu0.2xdm 1:1.1.11-1ubuntu1wdm 1.28-16slim 1.3.4-2.1lxdm 0.4.1-0ubuntu6kdm 4:4.11.8-0ubuntu6gdm 3.10.0.1-0ubuntu3lightdm 1.10.0-0ubuntu3