When disk space is low, apt-get install something operation (invoked by superuser) can uses the disk space over the watermark for the ordinary user (as in ext2 filesystem) and as a result, when normal user tries to use the system it finds the filesystem in which /var/spool/apt is located having no usable space left. Often this causes undesirable side effects. It would be nice if apt can warn this dire condition before the apt-get install begins. It is highly desirable that apt-get WARNS the dire condition to the superuser AFTER the apt-get install finishes and the space usable for ordinary user is zero. I assume that the judgement for the space being "low" can be user settable, etc. and so might be a little complex and so I say it would be NICE to warn the user beforehand and afterward. However, it is definitely desirable to print warning if the left over space is ZERO for ordinary user after the install operation, though. dpkg --status apt Package: apt Status: install ok installed Priority: optional Section: admin Installed-Size: 1984 Maintainer: APT Development Team <deity@lists.debian.org> Version: 0.5.4 Replaces: libapt-pkg-doc (<< 0.3.7), libapt-pkg-dev (<< 0.3.7) Provides: libapt-pkg-libc6.2-3-2-3.2 Depends: libc6 (>= 2.2.3-7), libstdc++2.10-glibc2.2 Suggests: dpkg-dev Description: Advanced front-end for dpkg This is Debian's next generation front-end for the dpkg package manager. It provides the apt-get utility and APT dselect method that provides a simpler, safer way to install and upgrade packages. . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in /usr/share/doc/apt/guide.text.gz
s/apt-get install something/any/ This doesn't seem like apt's responsibility. You could fill the disk just as easily using tar or dd as with apt (more easily in fact). In order for apt to warn about this, it would need to have an undesirable amount of intelligence about the type and configuration of the filesystem. apt doesn't know anything about filesystems, and there is no reason for it to learn now.
Matt Zimmerman wrote:
Thank your for taking the time to respond to my wish list posting about
apt behavior.
Your points are well taken, but under linux, I can be a little
careless since I am the sole user of this home PC and
I do need to get to update packages from time to time.
Anyway, regarding the file space detection,
the most likely culprit would be the usage under
/var/cache/apt. (Ordinary users tend to forget to run
apt-get autoclean from time to time [another warning
candidate...]), and so /var/cache/apt can fill up
over time.)
If we restrict the focus to /var/cache/apt,
won't the detection be a simple matter of running
df -k /var/cache/apt and look at the remaining size?
On my PC, it goes like this.
df -k /var/cache/apt
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/scsi/host0/bus0/target4/lun0/part6
7053444 6151964 543184 92% /
Aga. devfs device name struck...
But we can use -P flag to df.
ishikawa@duron$ df -k -P /var/cache/apt
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/scsi/host0/bus0/target4/lun0/part6 7053444 6151980
543168 92% /
ishikawa@duron$ df -k -P /var/cache/apt | tail -1 | awk '{ print $4; }'
543168
The last command is to obtain the remaining capacity.
Yes, I agree that checking the watermark (reserved for user)
is rather difficult, but then simple checking for this
remaining space or checking for the percentage is just fine.
If remaining space is less than 5% warn the user, etc..
Since apt-get is built to show the exact amount of
file space used for installing new package and
seem even to bother caculating the difference between
the space occuped by the current version of the package
and the space occuped by the new version of the existing packages,
a little extra effort to show the remaining file space at the
end of apt-get at the end of the execution won't hurt IMHO
(and the calculation should not be that hard and
users are better off even with a crude estimate based on df output.).
Anyway, thank you for the great package.
I wish more commercial distribution of linux pick up apt-like
package system.
df -k -P /var/cache/apt
df -k /var/cache/apt
This is true, and it is a regrettable side effect of the popularity of the command-line tool "apt-get". This tool is not a full-featured frontend to the package management system, and so does not provide a "friendly" interface which asks the user about things like cleaning /var/cache/apt. Ordinary users should probably be using aptitude, or (if they have a taste for that sort of thing) dselect.