I wanted to delete 5.4.0-26 kernel, and tried apt, but apt is getting bad at doing things, unlike in 18.04, where apt purge of the kernel version used to delete all the related packages.
But apt-get still does it great.
sudo apt-get purge <older_linux_version_number>
Example: sudo apt-get purge 5.4.0-26
and if you are so very sure of deleting the old kernel and its related packages, then say yes, using -y
sudo apt-get purge <older_linux_version_number> -y
Example: sudo apt-get purge 5.4.0-26 -y
you can delete multiple such old kernels in one go, just by passing multiple kernel versions separated by space.
sudo apt-get purge <older_linux_version1> <older_linux_version2> <older_linux_version3> -y
Example: sudo apt-get purge 5.4.0-26 5.4.0-28 5.4.0-32