Ubuntu 16.04 - Remove Old Kernel Lines
If you upgraded your Ubuntu 16.04 machine to the 4.13 kernel, it can be annoying to keep getting updates for the 4.4 and 4.8 kernels if you don't want them anymore.
To remove the existing kernels and prevent getting future 4.4 and 4.8 kernels, run the following:
uname -a
.
# Remove 4.4 kernels
sudo apt-get remove linux-headers-4.4.* -y && \
sudo apt-get remove linux-image-4.4.* -y && \
sudo apt-get autoremove -y && \
sudo update-grub
# Remove 4.8 kernels
sudo apt-get remove linux-headers-4.8.* -y && \
sudo apt-get remove linux-image-4.8.* -y && \
sudo apt-get autoremove -y && \
sudo update-grub
# Remove 4.10 kernels
sudo apt-get remove linux-headers-4.10.* -y && \
sudo apt-get remove linux-image-4.10.* -y && \
sudo apt-get autoremove -y && \
sudo update-grub
# Remove 4.13 kernels
sudo apt-get remove linux-headers-4.13.* -y && \
sudo apt-get remove linux-image-4.13.* -y && \
sudo apt-get autoremove -y && \
sudo update-grub
References
- Ask Ubuntu - How to remove new kernel and make older default (16.04)
- Ask Ubuntu - How to stop 16.04.2 with HWE kernel from updating to 4.4 kernels
Last updated: 4th January 2023
First published: 16th August 2018
First published: 16th August 2018