1

Possible Duplicate:
Is there a way to remove/hide old kernel versions?

I've been using dual boot on my PC for some time now, to use Ubuntu along side with Windows 7. One very disturbing thing happens, when Ubuntu linux core gets updated (this happens once in a while). They are added as options to the grub menu so, my boot menu now looks like this:

Ubuntu, with linux 2.6.35-27 generic
Ubuntu, with linux 2.6.35-27 generic (recovery mode)
Ubuntu, with linux 2.6.35-25 generic 
Ubuntu, with linux 2.6.35-25 generic (recovery mode)
Ubuntu, with linux 2.6.35-24 generic
Ubuntu, with linux 2.6.35-24 generic (recovery mode)
Ubuntu, with linux 2.6.35-22 generic
Ubuntu, with linux 2.6.35-22 generic (recovery mode)
Memory test
Windows 7

This gets very annoying, because I want to load windows by default, but after every update it shifts down and I have to go to grub config and change the default option.

My question: How to get rid of older versions of linux in the grub menu and leave only the newest one?

Silver Light
  • 2,647

6 Answers6

4

I would suggest that you always keep not only the latest kernel, but also the previous one. This way if at some point you find issues with latest kernel, you can still 'downgrade' your system to the previous stable configuration.

bitwelder
  • 386
3

With Ubuntu Tweak is the easiest way to remove old kernel images.

Here is a tutorial http://www.ubunturoot.com/2010/03/how-to-remove-old-kernel-images-in-grub.html

2

The simple way is to go to synaptic and search for the kernels which are not in use

In your case search for 2.6.35-25 & 24 & 22 and completely remove them. You can even check which kernel you are using with uname command in your terminal and remove other kernels that are installed or You can use softwares like ailurus or ubuntu-tweak which will remove unused kernel.

This thread on askubuntu talks about your issue and says Computer Janitor in Administration > Computer Janitor will do the trick as well.

sagarchalise
  • 24,306
2

You could install ubuntu-tweak and then Go to Applications -> System tool -> ubuntu tweak and

enter image description here click package cleaner and clean kernels. it does not show the currently used kernel so you will always be safe.

Lincity
  • 25,749
1

Install startup manager sudo apt-get install startupmanager (GUI for grub, usplash and splash screens).

Pick the default OS in the Boot options tab, and the number of previous kernel entries to keep in the Advanced tab. You can adjust many other options to your liking, too...

Christoph
  • 3,138
0

There has been a lot of answers. Adding to these answers you may try this : The grub menu is loaded from /boot/grub/grub.cfg ; if you are using ubuntu version later than 9.10. For previous versions it is the file /boot/grub/menu.lst.

Open that file and you will see the detailed lists of the menu (after a few lines of codes) block as the following style:

 ### BEGIN /etc/grub.d/. ...###
 menuentry  ...
            ...
 ### END ....................###

The last menuentry will be windows 7 . If you want windows 7 at the first of the menu cut this section and paste it before "Ubuntu, with linux 2.6.35-27 generic" menuentry block. If you don't want other menuentries youcan comment them out or delete them.

munir
  • 505