I used the script describe in this question to list the kernel installed on the computer :
How do I remove old kernel versions to clean up the boot menu?
In the 3.2.0, I have 33, 34, 35, 36, 37, 38, 39, 41, 43, 44, 45 and 48. I would expect to be running 3.2.0-48 after a reboot, but I am still running 3.2.0-32. Why the kernels installed by auto update are not used (and not offered in menu.lst)?
[I am running 12.04 LTS]
grep title /boot/grub/menu.lst result in :
title Ubuntu 12.04.1 LTS, kernel 3.2.0-32-generic
title Ubuntu 12.04.1 LTS, kernel 3.2.0-32-generic (recovery mode)
title Ubuntu 12.04.1 LTS, kernel 2.6.32-45-generic
title Ubuntu 12.04.1 LTS, kernel 2.6.32-45-generic (recovery mode)
title Ubuntu 12.04.1 LTS, kernel 2.6.32-44-generic
title Ubuntu 12.04.1 LTS, kernel 2.6.32-44-generic (recovery mode)
title Ubuntu 12.04.1 LTS, kernel 2.6.32-43-generic
title Ubuntu 12.04.1 LTS, kernel 2.6.32-43-generic (recovery mode)
title Ubuntu 12.04.1 LTS, memtest86+
I would have expected the kernel between 3.2.0-33 to 3.2.0-48 to be in this file and the default to be latest. Why the kernel 3.2.0-33 to 48 are not added in this file?
When I ran sudo dpkg-reconfigure linux-image-3.2.0-48-generic
, it found all the other kernels, and regenerated menu.lst, but in contains only the same 9 entries.
You are asking two questions: Why did it happen, and how do I fix it?
What should happen
When the package manager installs a new kernel, the script at /etc/kernel/postinst.d/apt-auto-removal marks the previous kernel for deletion the next time the package manager runs. It does work properly for most users most of the time.
The script is rather conservative. It doesn't delete all old kernels, and it errs on the side of leaving kernels in place rather that erroneously delete your current kernel or previous kernel (in case you need to revert). It doesn't scan to see all the kernels you have installed - it just uses the version numbers of the new and current kernels.
Why it didn't happen
There could have been a bug in the script, a different package management problem could have prevented the marking, several user actions could have remarked the package to manually-installed before deletion. The exact cause is unknown and possibly unknowable. It's all a rich tapestry.
How to fix it
Fixing is very easy. You need two pieces of information:
Example:
Ignore all the file names. Look at all the version numbers. You can see from the example the there are two kernel versions installed:
So we can delete the old kernel:
When a kernel is removed, the package manager will automatically remove all those files from /boot and update the grub menu.