Skip to content

Instantly share code, notes, and snippets.

@rooty
Forked from Snawoot/remove_old_kernels.sh
Created January 15, 2018 22:59
Show Gist options
  • Save rooty/1c1e5b8c09cd6244df187640dc0f80fd to your computer and use it in GitHub Desktop.
Save rooty/1c1e5b8c09cd6244df187640dc0f80fd to your computer and use it in GitHub Desktop.
Remove old kernels in Debian/Ubuntu
dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment