1-liner to Remove All Unused Linux Kernel Headers, Images and Modules
1 min readJul 24, 2018
Originally published 11th December, 2014
Particularly useful if /boot is filling up:
dpkg -l ‘linux-*’ | sed ‘/^ii/!d;/’”$(uname -r | sed “s/\(.*\)-\([⁰-9]\+\)/\1/”)”’/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0–9]/!d’ | xargs sudo apt-get -y purge