Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Ubuntu 18.04 - Remove Old Kernel Lines

If you upgraded your Ubuntu 18.04 machine to the 5.0 kernel, it can be annoying to keep getting updates for the older kernels if you don't want them anymore. To remove the existing kernels and prevent getting future updates for them run the following: Make sure you are running in a 5.0+ kernel before performing the steps below. Check this by running uname -a.

# Remove 4.15 kernels
sudo apt-get remove linux-headers-4.15.* -y && \
sudo apt-get remove linux-image-4.15.* -y && \
sudo apt-get autoremove -y && \
sudo update-grub
Last updated: 4th January 2023
First published: 18th September 2019