#1079512 apt: apt-get could have disk space warnings too

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Helge Kreutzmann
Date:
2024-08-24 09:15:03 UTC
Severity:
normal
#1079512#5
Date:
2024-08-24 07:36:34 UTC
From:
To:
I just did the usual
apt-get update
apt-get dist-upgrade

Apt-listchanges showed me the changes and I let apt continue. Then the
installation failed because disk space was too low. I could not
continue using apt to fix this (hence severity important), but I had
to manually move parts of /usr to other places until I could finish
the "dist-upgrade".

It turned out that I had to move ~ 1 GB (!) until this was the case.

I really wonder why apt cannot detect that such a big chunk of space is
missing and then would refuse to start the installation. (I initially
believed it was just off a few MB.)

(I was shown how much disk space is used after installation, but I did
not read it in detail, especially since I did not expect /usr to be
such low).

Since the extracted size of the to be installed packages is know, on
the command line it would be as simple as comparing that size with
the output of "df /usr" and then warning the user or refusing to
continue.

I'm now recovering, moving files back to /usr and deinstalling
packages, so my system is back to normal soon, hopefully. And then
booting from a recovery disk to enlarge /usr is the next step, of
course.

Please tell me which logs and further information you need,
unfortunately I failed to create "screen shots" because recovery was
my prime objective in the first moment.

#1079512#10
Date:
2024-08-24 08:11:13 UTC
From:
To:
Control: severity -1 wishlist
Control: retitle -1 apt: apt-get could have disk space warnings too

*apt* since 2.9.1, in the new user interface, informs you about the space
usage required and displays a very prominent warning, defaults the prompt
to N, and changes it to

    Continue anyway?

instead of

    Continue?

If the install size * 1.1 >= available space (not even free space).

I suggest you use it.

*apt-get* is a legacy interfacing for scripting purposes with the
utmost importance awarded to not changing behavior, as such the
full change seems out of scope for it.

I anticipate the warning will also migrate into the legacy interface,
it seems reasonable we can enable it in apt-get too. However, what
we can't do is change the prompt default to N, or change the prompt
text for it.

This isn't the only absurd behavior it has; it also will fall back
to treating an argument containing . or + as an unanchored regular
expression, so apt remove g++ if we were to remove g++ would remove
any package containing g in the name.

Going forward we will have stable interface versions you can request
from the apt(8) interface, negating the need to use the legacy dangerous
apt-get command which should then start beginning issuing its own
deprecation messages perhaps such that we can get rid of it in maybe
2030 or 2035.

#1079512#19
Date:
2024-08-24 09:13:09 UTC
From:
To:
Hello Julian,
Am Sat, Aug 24, 2024 at 10:11:13AM +0200 schrieb Julian Andres Klode:

Thanks for the prompt reply and information. I'll be more careful in
the future.

Greetings

          Helge