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

Re: Bug#650077: dpkg: The Installed-Size estimate can be wrong by a factor of 8 or a difference of 100MB



On Wed, Jan 07, 2015 at 12:22:47PM +0100, Johannes Schauer wrote:
> It is also worth asking what functionality the Installed-Size field is supposed
> to have when looking for a solution. It's primary purpose is probably to give
> apt a clue of whether or not there is enough free space to install a certain
> package.

This was/is a recurring question. The policy expends 4 on the field in
section 5.6.20. It fails however to clarify the purpose and thus the
preferred way of computing or using it.

> I think that an over approximation would be the right way to go because it is
> better to wrongly warn the user that a binary package might not be installable
> due to not sufficient remaining disk space, than to install a package without
> sufficient remaining disk space and only fail once there actually is no more
> space.

Consider Alice. She wants to install foo, which has a good approximation
for her filesystem. Unfortunately, it is too big to be installed. Thus
she looks at other packages and determines that she no longer needs bar.
Duly she issues "apt-get install foo bar-". Unfortunately, this command
fails unpacking foo as bar's approximation was bad and thus it does not
free the space advertised in Installed-Size.

> 	( find mathjax-2.4 -type f -print0 \
> 		| du --files0-from=- -b; \
> 		find mathjax-2.4 \! -type f -printf "1\n" ) \
> 	| awk '{total = total + int($1/4096) + 4096}END{print total}'

Slight improvement:

    find ... \( -type f -printf "%s\n" \) -o \
             \( ! -type f -printf "1\n" \) | ...

Helmut


Reply to: