For example, if I run the following command dpkg -l *compiz* the output is as follows:Desired=Unknown/Install/Remove/Purge/Hold| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)||/ Name           Version      Architecture Description+++-==============-============-============-=================================pi  compiz         1:0.9.12.2+1 all          OpenGL window and compositing manii  compiz-core    1:0.9.12.2+1 amd64        OpenGL window and compositing manun  compiz-core-ab <none>       <none>       (no description available)[more output deleted]The output is a little cryptic. There are several detailed explanations on StackExchange, of which, example, is one. Likewise, man dpkg and man dpkg-query give similar explanations.The first character in the first field, p, in our example output above, indicates the desired status of the package. Which is the status that the packaging system thinks the package should be in.What is the underlying meaning of the desired status? I.e. Why does the packaging managing system have an idea of what status a package should be in? I could see that an intelligent system would recommend (or desire) a package to be purged if it was only ever used as a dependency to an already removed parent package. However, this is not the case in our example.In our example, the package compiz is installed, however dpkg believes it should be purged, or at least that it is desirable that the package is purged, why is this? Moreover, how does this particular field work in general? I.e. how does the system decide on a desired status for a package and what are the underlying reasons for this functionality?
How is the desired status in the Debian Package Manager determined?
package management;dpkg
The p is NOT what the packaging system thinks the desired status should be.It's what you, or someone else, has TOLD it that it should be - e.g. with a program like aptitude or synaptic, or even a simple utility like apt-mark.It is marked to be purged the next time an apt-get dselect-upgrade, apt-get dist-upgrade, aptitude full-upgrade or similar is run.apt is great at dependency resolution, but it's not intelligent and it doesn't make decisions like that for you.  It tries to do what you told it to, to the best of its ability.  Usually that Just Works.  Sometimes it either bails out because the conflicts are unable to be resolved automatically, and sometimes when you run it, it offers to remove hundreds of packages you don't want it to so you have to say no.  In cases like that, you'll have to resolve the problem yourself (with the help of tools like aptitude).If you want to change the desired status of the compiz package, you could run something like:apt-mark install compizNote: as is always the case with packages, this will interact with the Dependencies and Conflicts of other packages.  If, for example, it gained that p status because you used aptitude to mark another package to be installed that happens to conflict with compiz, then that creates a dependency conflict that will have to be resolve when you run apt-get dist-upgrade.