Skip to content

Instantly share code, notes, and snippets.

@mss
Created December 2, 2015 08:49
Show Gist options
  • Save mss/a87b1b4356354cbf61b8 to your computer and use it in GitHub Desktop.
Save mss/a87b1b4356354cbf61b8 to your computer and use it in GitHub Desktop.
A onelines to mark all kernels except the current and the most recent as autoinstalled on Ubuntu
ls -1d /boot/abi-* | cut -d - -f 2- | sort -V | fgrep -v $(uname -r) | head -n -1 | sed -e s:^:linux-image-: | xargs -r apt-mark auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment