How to remove old kernel on Ubuntu operating system
Solution 1:
To remove old kernel versions on Ubuntu 18.04 or above :
sudo apt-get -y --purge autoremove
To remove old Kernel Ubuntu 16.04 LTS and older :
sudo -i
apt-get -y --purge remove $(dpkg --list | egrep -i 'linux-image|linux-headers' | awk '/ii/{ print $2}' | egrep -v "$i")