Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Executing dpkg --get-selections shows packages with one of the markers install or deinstall.

Some packages I could remove completely with apt-get remove.

  1. What does deinstall mean?

  2. What can be done so that the packages marked deinstall are not listed by dpkg --get-selections anymore?

share|improve this question

What does "deinstall" mean?

This means the package is selected for de-installation or removal (i.e. we want to remove all files, except configuration files). As the man page tell us

What can be done so that the packages marked "deinstall" are not listed by "dpkg --get-selections" anymore?

There are two ways you can do for not to be listed in the dpkg --get-selections command.

1. Unselect the packages for removal

You can unselect the packages, which are selected for removal. In this way, dpkg --get-selection will not show "deinstall" entry.

Look at this answer for the exact procedure to do this

2. You can actually do the selected task, i.e deinstall them

It is not recommended, If you have done a dpkg --clear-selections accidentally, which mark all packages as "deinstall" except the essentials one (Here, essentials doesn't mean You can have a system without any unnecessary software, essentials mean, You can only boot and have a very low-level linux system).

The command to do the desired task selected is:

sudo apt-get dselect-upgrade

Hope this will answer your query.

For more information you can check these links.

share|improve this answer
You write "is selected for de-installation or removal (i.e. we want to remove all files, except configuration files)". Well, how did I ("we") select that? Is that what happens when I "apt-get remove ..."? And if so, why are they only "selected for de-installation", why are they not removed instantly when running "apt-get remove"? – Mads Skjern May 29 '15 at 12:42
You write that it is not recommended to dselect-upgrade. Is that only because, in the case that one has accidentally run --clear-selections, it goes to bare-bone. Or is it for other reasons as well? It seems sort of like an obvious thing to do, to de-install things that are selected for deinstallation :/ ?? – Mads Skjern May 29 '15 at 12:45

The "sudo apt-get dselect-upgrade" answer did not work for me. To remove a single deinstalled package I used:

sudo apt-get --purge remove <package_name>
share|improve this answer

If apg-get --purge fails to remove the package try:

Check the deinstalled packages to make sure you really want to remove them.

dpkg --get-selections | grep deinstall | cut -f1

Execute dpkg --purge

sudo dpkg --purge `dpkg --get-selections | grep deinstall | cut -f1`
share|improve this answer

Your Answer


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.