dpkg -l | grep ii | awk '{print $2}' | \
grep -E 'linux-(image|headers|ubuntu-modules|restricted-modules)' | \
grep -vE 'linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)' | \
grep -v $(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g') | \
xargs apt-get -y purge
Last active
July 21, 2018 05:57
-
-
Save faleev/5912206 to your computer and use it in GitHub Desktop.
Delete old kernels on Ubuntu/Debian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment