Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to remove the unwanted entries from the boot menu?

I want to limit the number of kernels shown in my boot screen to say only the two latest ones. How can I do this with the new grub? (Any method that does not require manually uninstalling all extraneous kernels is also welcome.)

share|improve this question

marked as duplicate by Marco Ceppi Mar 21 '11 at 16:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Possible duplicate of Is there a way to remove or hide old kernel versions? . – belacqua Mar 20 '11 at 20:24

You'd need to remove the individual kernel images you don't want. I have every kernel starting with the one packaged on the 10.04 LTS disc up to the most recent one (including the backported kernel). There's no automated process to remove old kernels, so you'd have to remove each individual image from your system using Synaptic or some other package manager.

share|improve this answer
Exactly the kind of task that should be automated. – apoorv020 Mar 20 '11 at 17:44
Except that there is no automated process. This is because of the fact that should the newest kernel not operate properly, you can use the older kernel which you already know works. – Thomas Ward Mar 20 '11 at 17:48

A detailed procedure for removing old Linux kernels and cleaning up Ubuntu's boot menu to use just the latest and next most recent kernels is provided in a series of recent posts starting with GRUB2 revisited.

While the procedures listed in the above are all manual, one of the web references listed refers to a number of graphic tools that may be useful in modifying the boot menu. The specific article is Customise Ubuntu with GRUB.

share|improve this answer
+1 Excellent links. I assumed the start-up manager was incompatible with GRUB2, but it seems they just don't include it now. – apoorv020 Mar 20 '11 at 19:08
However, this tool does not remove the old kernels, and as such the old kernel images will be sitting there taking up memory space that a user might otherwise need. – Thomas Ward Mar 20 '11 at 23:23

Legacy GRUB had a variable in memu.lst called HOW_MANY which was how many kernels to retain which took care of this for you. One of the many legacy GRUB features we have lost. I have no idea why GRUB2 does not support this.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.