How do I list installed software with the installed size?

dpkg-query -W -f='${Installed-Size;8}  ${Package}\n' | sort -n

shows you a package list sorted by size


You can do this graphically in Synaptic Install synaptic.

First ensure that you enabled the Installed Size and Download size columns (or only one if you want that one).

  • To do this, go to Settings > Preferences and choose Columns and Fonts, then tick the columns you want to see.
  • Then click OK.

Preferences window

  • Once they are enabled, you can list the packages you have installed by download/installed size by click on the column.

Columns

  • Please note: I do not have my packages listed in that way this screen shot, but it works.

Preferred solution

I have found a shorter answer, not requiring aptitude:

dpkg-query -Wf '${Installed-size}\t${Package}\n' | column -t

Old proposed solution

The show command of aptitude is able to show the installed size of a package.

I have this little script, that make use of aptitude (to install separately) to have a list of all installed packages with sizes:

#!/bin/bash

export LC_ALL=C

aptitude show $(dpkg-query -Wf '${Package}\n') |
  awk '$1 == "Package:"     { name = $2 }
       $1 == "Uncompressed" { printf("%10s %s\n", $3, name) }' |
  awk '$1 ~ /k/ { $1 *= 1 }; $1 ~ /M/ { $1 *= 1024 }
       { printf("%9d %s\n", $1, $2)}'

Size are expressed in kilobytes, and are approximate, as returned by aptitude show pkg.

The script can be improved using a single awk invocation (but I'm lazy :-)


Another option is to use the dpigs application from the debian-goodies package:

NAME
   dpigs - Show which installed packages occupy the most space

SYNOPSIS
   dpigs [options]

DESCRIPTION
   dpigs sorts the installed packages by size and outputs the largest ones. Per
   default dpigs displays the largest 10 packages. You can change this value by
   using the -n option (see "OPTIONS"). The information is taken from the dpkg
   status file with grep-status(1).

OPTIONS
   -h, --help
       Display some usage information and exit.

   -n, --lines=N
       Display the N largest packages on the system (default 10).

   -s, --status=FILE
       Use FILE instead of the default dpkg status file (which is /var/lib/dpkg/status
       currently).

   -S, --source
       Display the largest source packages of binary packages installed on the system.

You can view such a list in the terminal-based package manager Aptitude:

  1. Open Aptitude with sudo aptitude.
  2. Hit S (capital S) and type ~installsize at the prompt. (The ~ is for descending sort; you can omit it if you want the smallest packages on top.)
  3. By now, packages are sorted by size inside each hierarchical level. To get an overview, you'll want as few levels as possible. Hit G and enter status at the prompt. Now all installed packages are in a single section, sorted by size.