Clean unused kernels when boot partition is full

My /boot partition keeps getting full so I must regularly clean it.

Quick instructions:

  • Show current linux kernel used
    uname -r
  • Show all installed kernels
    dpkg --list | grep linux-image
  • Remove old kernels which are no longer in use
    sudo apt-get remove linux-image-xxxx
    (replace xxxx) with the unused version numbers
  • For good measure, clean unused packages
    sudo apt-get autoremove
  • Optional: if the GRUB boot list is full of old kernel entries, update it by running
    sudo update-grub

Check out these articles for more info: