#!/bin/sh # lists installed Debian packages, sorting by package size # This could just be a perl script extracting the install package info. # but I made it a sh script to allow for sort manipulation afterwards. # Installed packages read from /var/lib/dpkg/status # found on: http://www.linuxquestions.org/questions/linux-software-2/do-i-need-usr-lib-debug-783100/#post3831610 echo ' open(FILE,"/var/lib/dpkg/status"); $_=; while ($_) { if ( /Package:/ ) { @package = split(" ",$_); $_=; if ( /install ok installed/ ) { do { $_=; } until ( /Size:/ ); @size = split(" ",$_); print( "$package[1] $size[1]\n"); } } $_=; } ' | perl | sort -nr -k2