Removing Old Kernels

Tom H tomh0665 at gmail.com
Sat Dec 12 17:30:40 UTC 2009


>>>>> There was a feature in ubuntu some time in the earlier releases where in
>>>>> there used to be only a specific copies of kernels maintained. The older
>>>>> one's would get deleted once the updates were applied. Not sure if its
>>>>> there in the current versions of ubuntu 9.10

>>>> You can add a "howmany=X" line to menu.lst to limit the number of
>>>> kernels that grub1's update-grub adds to menu.lst.

>>> Please advse of the path for menu.lst .

>> Unless I misunderstand you request, menu.lst is in folder /boot/grub when
>> using grub1.  For grub2, menu.lst is replaced by grub.cfg in the same folder.

> That is not the end of the story. How do you change grub.cfg?
> Menu.lst you just edited with gedit, simple. Editing grub.cfg
> is NOT SIMPLE!

Theoretically, you are not supposed to edit grub.cfg.

With grub2, you are have to edit /etc/default/grub and possibly some
files in /etc/grub.d like 40_custom and run update-grub.

There was a similar procedure possible in grub1. You could edit the
"Debian automagic kernels list" (similar to /etc/default/grub in
grub2) where you can set "howmany=X" and run update-grub.

OT regarding editing grub.cfg: I used to have a copy of
/boot/grub/menu.lst in /root and I would edit it and copy it over the
"active whenever update-grub was run (for example, when apt-get
upgraded the kernel) after making the changes that I wanted. And I now
do the same with grub.cfg.




More information about the ubuntu-users mailing list