[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#895897: Further comments on apt purge



On Mon, Apr 29, 2024 at 04:16:14PM -0700, Andrew Athan wrote:
> Note that
> 
> apt purge ~c
> 
> does something, but apt(8) does not mention the support for the ~c
> parameter.

It is relatively new and part of the aptitude-pattern backport.
See apt-patterns(7).


> On my system, it seems to be attempting to remove all packages that have the
> "c" second character status in dpkg -l.  Unfortunately, this includes
> packages such as "locales" which I think are normally "ic", so this command
> does not seem appropriate for removing "rc" packages as suggested elsewhere.

A package is not "normally" 'ic'… that is your "desire" who made it so.

As "dpkg -l" documents itself at the top, the first letter is a desired
state, while the second is current status (and the third if present
indicates an error state that is worse than the "normal" error states).

So, 'rc' expresses the desire for the package to be removed and the
current status is "removed, but not purged (conf-files remaining)".

You could set it to 'pc' (to desire a purge) or like you did to 'ic',
which would mean you desire it to be installed (again).


Note that this "desire" is something used by dpkg/dselect and to some
extend aptitude, but most (other) libapt-based tools including apt(-get)
do not really work with it (except in fringe use cases like apt-get
dselect-upgade) and/or internally while talking to dpkg. They prefer to
receive the users desire directly on the command line if you want to
interpret it this way.


So, yes and no, ~c does indeed match 'ic' as well as 'rc', but that is
because it looks at the current state – which is the same for them all,
they only have conf-files remaining.

Specifically, as you seem to think otherwise: "locales" in state 'ic' is
not installed and behaves exactly like in state 'rc' – as in, they don't
have a behaviour at all. If you want it to be installed, just install it
and it will have the state 'ii'. Or purge it and it will be 'un'.


Best regards

David Kalnischkies

Attachment: signature.asc
Description: PGP signature


Reply to: