Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to have a list the installed software on my machine, with the disk space consumed by them alongside. I would prefer to be able to order by largest/smallest, but that is not a necessity.

I am the sort of person who will install software to try it, and never clean up after myself.

As a result, my 7GB (Windows and my Data are on separate partitions, as well as a swap area) Ubuntu 11.04 partition is suffering, and has started regularly showing warning messages.

I have cleaned my browser cache, as well as everything under Package Cleaner in Ubuntu Tweak, and am left with 149.81 MB off free space.

share|improve this question

3 Answers

up vote 9 down vote accepted

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.
share|improve this answer
This is precisely what i was looking for! Thanks a lot. – Lewis Goddard Sep 20 '11 at 20:30
@LewisGoddard: you're welcome. – RolandiXor Sep 20 '11 at 20:33

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 :-)

share|improve this answer
You might want to throw a pipe to sort -nk1 on the end of that first command. – Marco Ceppi Sep 20 '11 at 19:19
@MarcoCeppi: yeah, it was not the main concern of the OP, and I usually leave out ordering from my scripts, given that it may be applied in different ways as needed. – enzotib Sep 20 '11 at 21:51
This also lists software that is not installed anymore. Is there a way to remove these from the output? – rumpel Jul 29 '12 at 17:15
dpkg-query -W -f='${Installed-Size;8}  ${Package}\n' | sort -n

shows you a package list sorted by size

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.