Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I run the command sudo dpkg-reconfigure lightdm, I'm taken to a screen that allows me to customize which display manager I want to use. It lists lightdm, gdm, and other display managers I have installed. I haven't used this command for other things, but I assume it lets you configure other categories of packages as well.

How does dpkg-reconfigure know what applications are display managers (or any other category you're configuring) and which aren't? If there is some categorization going on behind the scenes with apt-get, I'd like to know about it, and how I can view these categories.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

It gets the choices within its the config control file in the .deb package:

CHOICES=
if db_metaget shared/default-x-display-manager choices; then
  CHOICES="$RET"
fi

You can see meta-info about a package, including virtual functions it provides like "x-display-manager", with the apt-cache command:

steven@wind:~$ apt-cache show lightdm | head
Package: lightdm
Priority: optional
Section: x11
Installed-Size: 440
Maintainer: Robert Ancell <robert.ancell@ubuntu.com>
Architecture: i386
Version: 1.2.3-0ubuntu2.2
Provides: x-display-manager
Depends: debconf (>= 0.5) | debconf-2.0, upstart-job, libc6 (>= 2.4), libglib2.0-0 (>= 2.28.0), libpam0g (>= 0.99.7.1), libxcb1, libxdmcp6, libpam-runtime (>= 0.76-14), libpam-modules, adduser, libglib2.0-bin, dbus, plymouth (>= 0.8.2-2ubuntu31.1)
Pre-Depends: dpkg (>= 1.15.7.2)
steven@wind:~$

The Provides: x-display-manager line is the relevant piece here.

One way to find out which other packages provide this function is apt-cache search ...:

steven@wind:~$ apt-cache search x-display-manager
kdm - KDE Display Manager for X11
lightdm - Display Manager
gdm - GNOME Display Manager
lxdm - GUI login manager for LXDE
slim - desktop-independent graphical login manager for X11
wdm - WINGs Display Manager - an xdm replacement with a WindowMaker look
xdm - X display manager
steven@wind:~$

If you really want to dive into the details, the Debconf Programmer's Tutorial is a good place to start.

share|improve this answer
    
Thanks! The ability to search for packages with a certain category is really useful. Now I can easily find all of the display managers and window managers I can try out. –  gsingh2011 Jul 18 '13 at 3:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.