Skip to content

Instantly share code, notes, and snippets.

@stroebs
Created January 10, 2018 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stroebs/fc31f2f2ae65be54089373a8c32147b7 to your computer and use it in GitHub Desktop.
Save stroebs/fc31f2f2ae65be54089373a8c32147b7 to your computer and use it in GitHub Desktop.
Ubuntu Kernel cleanup one-liner
for kernel in `dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r) |grep "ii" |awk '{print $2}'` ; do dpkg --purge $kernel; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment