0

I'd like to have a reasonable computation of how much diskspace a certain program uses. Like so:

// Fiction
$ aptitude size -h latex 
folder1    250MB
folder2     15MB
----------------
total      265MB

Any kind of help will be appreciated. Maybe some listing of folders used by a specific program and then du?

Thanks.

1 Answer 1

3

You can query the local package database for the size of the package after it is installed:

apt-cache show <package> | grep Installed-Size

This won't include the size of an run-time generated data (e.g., querying for mysql-server-5.5 will return the size of the mysql server application, not including the size of any mysql databases). The information of which files to include in those size calculations would be dependent on the specific version of the specific package, and since that information is not kept in a general database, there's probably not a general solution for calculating it.

Note, if you're getting really small sizes for some packages, make sure you're not looking at an alias (e.g., mysql-client vs mysql-client-5.5)

2
  • And is there a way to get a list of related packages or dependencies?
    – Zajo
    Jun 10, 2014 at 19:59
  • Look them up recursively, or try installing the package via apt-get as a dry run (so that it doesn't actually install the package) and grep out the amount of additional space required. Requires root, though. Jun 10, 2014 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .