Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to remove old kernel packages

📅 2016-Jun-18 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Every Ubuntu update installs a new version of the Linux kernel. It keeps the old kernel packages as backup and does not remove them. It does not mark them for autoremove either. Occasionally, I manually remove the old kernel packages keeping the current version and one older version as backup.

Thankfully, I discovered that there is a program that does this exact operation now!

Install the bikeshed package:

$ sudo apt install bikeshed

To remove all old kernel packages except the current one and the next older one:

$ sudo purge-old-kernels

Tried with: Ubuntu 15.10