Skip to content

Instantly share code, notes, and snippets.

@ejoubaud
Created October 30, 2014 15:51
Show Gist options
  • Save ejoubaud/7e28c2be66284b6d4310 to your computer and use it in GitHub Desktop.
Save ejoubaud/7e28c2be66284b6d4310 to your computer and use it in GitHub Desktop.
Remove old kernels on a ubuntu box
# Identify the revision of kernel running:
uname -r
# Identify installed kernel packages:
dpkg --get-selections | awk '((/^linux-/) && (/[0-9]./)) {print $1}'
# Reboot box if not running the latest installed kernel.
sudo reboot
# Remove kernel packages (being careful not to uninstall the currently running kernel).
sudo apt-get purge linux-image-2.6.32-47-server linux-image-2.6.32-48-server ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment