paapereira.xyz

Removing old kernels from your system

After a while you’re starting to collect kernel versions on your system.

Since Hardy came out, with kernel 2.6.24-16, we had two kernel updates, so, in grub we have now entries to kernels 2.6.24-16, 2.6.24-17 and 2.6.24-18.

We just need one to boot in, and we and the most recent one of course. Still, when deciding to remove an old kernel be aware of possible problems.

Virtualbox for instance, needs a module to the specific kernel you’re running. Every time a new kernel is released your Virtualbox setup will not work until your upgrade the said module. So, if you need to use Virtualbox and you don’t yet have the new module, you could just restart into the old kernel.

So, think before you remove old kernels.

Removing old kernels

1sudo dpkg --list | grep linux-image
1ii  linux-image-2.6.24-16-generic                  2.6.24-16.30                                       Linux kernel image for version 2.6.24 on  x86
2ii  linux-image-2.6.24-17-generic                  2.6.24-17.31                                       Linux kernel image for version  2.6.24 on x86
3ii  linux-image-2.6.24-18-generic                   2.6.24-18.32                                       Linux kernel image  for version 2.6.24 on x86
4ii  linux-image-generic                            2.6.24.18.20                                       Generic  Linux kernel image
5ii   virtualbox-ose-guest-modules-2.6.24-18-generic 24.0.3                                             virtualbox-ose-guest module for linux-image-
6ii  virtualbox-ose-modules-2.6.24-18-generic       24.0.3                                             virtualbox-ose module for  linux-image-2.6.24
1uname -r
1sudo apt-get remove linux-image-2.6.24-16-generic
1sudo update-grub

And that is that.

#Linux #Ubuntu