Old Kernels . . .(never die!)

Karl Bowden karlbowden at gmail.com
Tue Jan 6 21:33:30 GMT 2009


On Wed, Jan 7, 2009 at 8:03 AM, The Wassermans <dwass at optusnet.com.au> wrote:
> On Fri, 2009-01-02 at 09:21 +1100, Dave Hall wrote:
>
>> I personally keep the previous kernel for a few days to make sure that
>> everything works properly.
>>
>> > 3.  How would I go about deleting them?
>>
>> Using GNOME go system > admin > synaptic package manager
>>
>> Search for "linux-image"
>>
>> Don't try to remove the highest numbered entry (that will be the kernel
>> you are running)
>>
>> For the remaining "linux-image-2.6.xx-y*" entries, just right click on
>> them and select "Mark for complete removal".  It will ask you to confirm
>> that you also want to remove the related restricted modules package as
>> well.
>>
>> When done click Apply.  Confirm that you are happy with the changes by
>> clicking apply.  Wait for synaptic to work its magic.
>
> I  did all of that Dave.  Actually, I did the above for Kernel #16, as a
> test. Upon re-booting the pesky #16 was still there.  So I re-booted and
> selected #16 and got the error message: "file not found". I have tried
> all the remedies suggested by the other members but nothing seems to get
> rid of the long list of Kernels at start-up.
>
> Not that it's all that important really.  It's just a matter of
> aesthetics.  And the frustration at trying to fix something that should
> be quite easy

Just as a matter of - hey this is how I manager my old kernels.
I'm not sure sure about the gui way of doing it, but to see a list of
kernels and kernel related packages I have installed, from the command
line I use:

dpkg -l | grep linux

If I then want to filter it to a specific kernel I would copy the
kernel version and paste it at the end of the line instead of linux:

dpkg -l | grep 2.6.27-7

I can then remove an old kernel using the names of the packages listed, eg:

sudo apt-get remove linux-headers-2.6.27-7
linux-headers-2.6.27-7-generic linux-image-2.6.27-7-generic
linux-restricted-modules-2.6.27-7-generic

It is safe to just remove only the image package too and leave the
rest. They will not be used by most systems after the image is gone
anyway.

And by the sounds of the symptoms of your grub file, it is not being
updated automatically anymore by update-grub. If you run:

sudo update-grub

It should list the kernels as Found kernel and update
/boot/grub/menu.lst at the end. It is probably not completing it's
task anymore because of the manual changes to /boot/grub/menu.lst. I
would not go replacing my menu.lst file with someone else's without a
bit of experience, but if I did, I would need to update the kopt and
groot lines to reflect my ubuntu partitions UUID (as found in your
current menu.lst. Then on running sudo update-grub the kernel lines
would be generated again and invalid entries removed.

I know it's a bit light on details, but just ask if there is anything
you want clarified above. (I'm used to working in a quiet office
without human contact).

- Karl



More information about the ubuntu-au mailing list