Clean up Your Boot Partition Ubuntu

If you constantly run out of space in the boot partition, you might need to run the following command to cleanup the boot partition.

First, list all installed kernels

dpkg -l linux-image-* | grep ii

Second, delete the chosen old kernel

apt-get purge linux-image-4.4.0-XXXX*

Other command worth noting:

apt-get autoremove

or

apt-get --purge autoremove

Cleanup this file below by removing old kernel entries.
/etc/apt/apt.conf.d/01autoremove-kernels

or

Remove the old kernels files manually
You can also remove the old kernels manually. I suggest leaving the older one and the latest.
Delete the kernels in between.