0

I'm learning Debian's package management system and have read Chapter 2. Debian package management. But I have difficulty in understanding the concept of "selection", or maybe "package selection". More specifically:

  • What exactly is a "package selection"?
  • What does a "package selection" select?
  • Under what circumstances do I need to care about a "package selection"?

For example, whenever I want to find whether I have a package installed on my system, I usually run dpkg --get-selections 'PACKAGE-NAME'. Frankly speaking, I don't know exactly why the option is called get-selections and why I should use it. I turned to dpkg manpage, but it doesn't explain further. The chapter above doesn't seem to explain, either.

While I'm reading the Debian reference, I see another tool called dselect which also helps manage the packages. I'm also curious why it is called "select", and this may be a hint to understanding the concept of "selection".

According to my current research, I have some guesses of what it is about:

  • The "selection" may have something to do with multiple versions of the same package. I can install all the versions on my system, but the "selection" specifies which version is the active one.
  • The "selection" may have something to do with alternative packages that serve the same purpose. For example, I may install vi, vim, and nvi on my system, and the "selection" specifies which one is the actively used one.

However, the understandings above don't look right because that seems to be solved by using the symbolic links.

Hope someone would explain it to me. Thanks for the help!

yaobin
  • 2,436
  • 5
  • 33
  • 54
  • 1
    You’ll probably get better help with this on [unix.se]. – elixenide Mar 30 '18 at 15:02
  • @EdCottrell Make sense! Is there a way to move the question between sites? Or do I have to repost it there? – yaobin Apr 02 '18 at 20:40
  • You might want to consider the site's ["be nice" policy](https://stackoverflow.com/help/be-nice). Generally, telling someone who's trying to help you, "Make sense!", is not going to be seen as being nice. You could have deleted the question and posted it on the other site. Since you got help here, you don't need to do that. I'm not sure why you would accept an answer here and then yell at the first person who tried to point you in the right direction. – elixenide Apr 02 '18 at 20:45
  • @EdCottrell Oh, my apology, Ed. I didn't realize "make sense" may not sound nice in this context as English is not my mother tongue. I thought "make sense" may be the same as "good idea" here. I didn't mean to be rude. – yaobin Apr 02 '18 at 21:36
  • No problem, and thanks for the clarification. It sounds like you were looking for “makes sense,” as in, “that makes sense!” “Make sense,” without the `s` in “makes,” is a commandment, as in, “You don’t make any sense; stop that.” English is tricky! ¯\\_(ツ)_/¯ – elixenide Apr 02 '18 at 21:40
  • 1
    @EdCottrell Aha, I think next time I'll directly say what I mean, such as "good idea" or "thanks for the suggestion", which should be safer. :D – yaobin Apr 02 '18 at 21:46

1 Answers1

2

If you write dpkg --get-selections (this command is often included in crontab so that we backup the actual package installed on a machine), you get the list of all packages, installed, and deinstalled (but not purged).

So the selection is one of the status of the package:

  • install: the package is installed
  • deinstall: the package is no more installed (but config file are keep, so the package is not like non installed (or purged) packages). The dpkg still keep track of config files.

As far I know, you can tell dpkg also to install, hold, deinstall or purge (--set-selections)

This is a sort of selection, so the name. There are other statuses (successfull installed, error on postinst, error on untar, ...).

Note: Debian Reference Manual is a very old manual, grown "organically". Feel free to fill a bug (minor or wish), so that volunteers can improve it.

Giacomo Catenazzi
  • 8,519
  • 2
  • 24
  • 32