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

Re: disk usage for /usr/lib on bullseye



On 2023-05-02 at 10:28, Bret Busby wrote:

> On 2/5/23 20:23, Michel Verdier wrote:
>
>> Le 2 mai 2023 Bret Busby a écrit :
>> 
>>> I expect that, by context, running
>>> apt purge
>>> without the restriction specifying particular package, will apply
>>> apt purge
>>> to all installed packages, according to what purge does, in relation to
>>> packages.
>> 
>> But as "apt purge <package>" remove this package and remove configuration
>> for this package, I hope that "apt purge" will not remove "all installed
>> packages". Personnally I will not test it...
>> 
> I believe that this is a case of a problem with having different primary 
> languages (me, English, the above poster, French), with things getting 
> "lost in translation".
> 
> I did not mean that purge will remove all installed languages; as 
> according to my last previous post in this thread (I think it was my 
> last previous post - I am not sure);
> apt purge
> apparently removes obsolete configuration files (orphaned configuration 
> files - that would have been associated with only packages that have 
> been removed), and, so, where a particular package is specified as an 
> argument to the command, all obsolete configuration files associated 
> with the package, will be removed, and, where no package is specified as 
> an argument to the command, all obsolete configuration files for "all 
> installed packages", will be removed.
> 
> No suggestion has been made, insofar as I am aware, other than in the 
> above post, that using
> apt purge
> will remove all installed packages.

I continue to be bewildered that the idea that it will do *anything* has
even come up.

My understanding, for more than a decade now, has been (as it continues
to be) that:

'apt-get remove packagename' will remove the package, if it's installed,
but not remove its config files.

'apt-get purge packagename' will remove the package, if it's installed,
and also remove its config files, if they are present.

'apt-get remove' with no 'packagename' argument is a syntax error.

'apt-get purge' with no 'packagename' argument is a syntax error.

The command 'apt' is newer than that, I think, but I see no reason to
think that these verbs would behave any differently between the two
commands.

Aside from some possibly-unclear wording in the man page(s), where is
the idea that running either of these verbs with no package-name
argument will make them apply to *all installed packages* coming from?
That would be an *insane* design decision, IMO, and it seems bizarre
that anyone is even coming up with the idea in the first place, let
alone that it's being given any credit.

> I think that, to remove all installed packages, a system administrator, 
> from the superuser level, needs to run something like
> rm -r /
> (assuming that the /bin and /sbin (etc, etc, etc) directories are within 
> the / partition, and, not in partitions separate to the / partition)
> - the use of which command, I do not recommend.

That would remove far more than all installed packages; it would also
remove all files not included in any package, and potentially also all
files on any mounted network shares, et cetera.

IIRC, there are packages which the system will refuse to remove, unless
an appropriate overriding action is taken. It may now be the case that
there are packages which the system will refuse to remove entirely,
without offering any means to override the refusal.

If that were not the case, removing all installed packages could
probably be done by something like

apt-get remove $(apt-mark showmanual) $(apt-mark showauto)

except that A: the resulting list of packages would probably be too long
for a single command line, and B: one of the packages which this would
try to remove (probably fairly early on, since they'd be listed in
alphabetical order) would be the 'apt' package itself, which contains
both 'apt-mark' and 'apt-get', and so the process would probably break
after that.

It's a pointless thing to discuss, in any case, since I have been unable
to think of essentially any reason why anyone would ever want to do any
such thing.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: