This script is used to remove old kernels cluttering /boot on Ubuntu systems. The following kernels are preserved:
- The running kernel
- The latest kernel from each major version
This means that, if for example linux-image-server and linux-image-generic-lts-quantal are installed on an Ubuntu Precise system, the running kernel, the latest 3.2.0 kernel and the latest 3.5.0 kernel are preserved. All other kernels and header files are purged.
- Copy kernel-cleanup to /usr/local/sbin and make it executable
- Copy kernel-cleanup_dpkg-hook to /etc/apt/apt.conf.d/98-kernel-cleanup