Frequent upgrades of the Linux kernel cause warnings that the /boot partition runs out of space during the update. This is because after upgrading the kernel for many times, there are too many kernel versions, and it is enough to clean up the useless kernel files. The command is as follows:
dpkg -l 'linux-image-*' | grep '^ii'
or
dpkg --get-selections |grep linux-image
ls /boot
You can see that there are some kernel startup files. Obviously, some of them are not needed by us (it is recommended to uninstall older kernels first). If you don't need them, just delete them as garbage. In theory, you can uninstall everything except the ones you are using, but the newly upgraded things may be unstable. To be on the safe side, keep 1-2 previous versions for backup .
Note: Before uninstalling the old kernel, first use uname -a to check which kernel is currently booted (to prevent uninstalling the currently used kernel):
zht@zht-Ubuntu:~$ uname -a
Linux zht-Ubuntu 3.5.0 -26-generic #42-Ubuntu SMP Fri Mar 8 23:18:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
========================= ======
Uninstall the old kernel, the command is as follows:
//Uninstall linux-image-3.5.0-17-generic
zht@zht-Ubuntu:~$ sudo apt-get purge linux-image-3.5.0-17-generic
Then enter yes according to the prompt to complete the uninstallation.