↑ ↓ select, Enter open, Esc close

List installed packages sorted by size

Adjust the values, the command updates live
user@server
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn | head -n 20

Queries the installed size of every installed package and sorts in descending order. The first column is the size in KiB, the second the package name. Useful when / or /usr runs low and you want to know which packages take up the most space.

Note: Old kernels (linux-image-*) often appear near the top. Do not remove them manually if the running kernel belongs to them (uname -r).

Also searched as

  • which packages use the most disk space
  • find largest installed packages debian
  • root partition full because of packages

Related one-liners

All in Debian and APT

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.