Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

With each kernel update, a new entry is placed in Grub to provide a way to boot that specific kernel version.

I have about 5 at the moment and, to be honest, once I have confirmed I can boot into the new kernel version, I never go back to a previous version.

I'd like to manage the items in this list from the desktop rather than edit the file, is there a way to do this using the GUI from within Ubuntu itself?

share|improve this question
add comment

6 Answers

up vote 12 down vote accepted

Yes, remove the packages.

Load up synaptic and search for linux-image. Click the first column to sort by packages that are actually installed and then click the green boxes to alter the state.

You're looking for packages that look like: linux-image-2.6.31-ubuntu10. Don't remove linux-image as that will stop updates coming in.

Just mark the ones you don't want anymore and then click apply. I would suggest (if you're happy with it) removing all but the current kernel and the one before it (just in case).

When you're done, click apply and grub gets cleaned up.

share|improve this answer
3  
This will also save a bit of space on your disk since each kernel-image-2.6* takes up around 100mb and at the speed that new kernels come out in Ubuntu it can easily get to 1-2 GB's –  Source Lab Aug 12 '10 at 11:51
    
Amen to disk space. This is especially true when you're on an early development release and you get new kernel builds every other day. –  Oli Aug 12 '10 at 14:04
    
It honestly never occurred to me to uninstall the packages. Big +1 for saving space! –  Neil Trodden Aug 12 '10 at 15:25
    
What if the "mark for removal" option is greyed out? –  Brandon Bertelsen Oct 7 '10 at 20:07
add comment

You can install a program called StartUp-Manager.

The package is called startupmanager. You can search for this in the Ubuntu Software Centre or Synaptic or run:sudo apt-get install startupmanager in a terminal.

It allows you to select the what grub entry is default, the number of seconds grub waits until it automatically boots and other options, such as resolution.

It is a good idea to uninstall old kernels from synaptic though.

share|improve this answer
1  
Just want to add that startupmanager is no longer under active development: launchpad.net/startup-manager/+announcement/8300 –  cringe Jun 4 '11 at 9:38
add comment

It's not GUI based, but the easiest way to remove previous linux images is to issue the simple command :

sudo apt-get autoremove

This will remove ALL cruft from your system, not just linux kernels. Anything that isn't used by another package will be removed that that command.

If you simply must have a GUI, then start Synaptic then click on the "Status" button at the bottom left, then choose the "Installed (Auto Removable)" filter from the list above it. Then choose everything in that list (shift or control clicking or use CTRL-A), and right-click to select "Mark for Removal".

For example, below, I'm running the 2.6.35.27 kernel, so if I want to remove the previous 2.6.35.25 kernel :

scaine@GroovyTosh:~$ uname -r
2.6.35-27-generic
scaine@GroovyTosh:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-backports-modules-input-2.6.35-25-generic oss-compat
0 upgraded, 0 newly installed, 2 to remove and 44 not upgraded.
After this operation, 172kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 277680 files and directories currently installed.)
Removing linux-backports-modules-input-2.6.35-25-generic ...
update-initramfs: Generating /boot/initrd.img-2.6.35-25-generic
Removing oss-compat ...
scaine@GroovyTosh:~$ 
share|improve this answer
    
This command did not present any packages for removal? Also, "Installed (Auto Removable)" is not in my Status filter list. –  Neil Trodden Aug 12 '10 at 19:49
    
The status items are dynamic : once you've removed everything that can be removed, the entry will disappear. Similarly, the command "sudo apt-get autoremove" will simply say something like "0 upgraded, 0 newly installed, 0 to remove and 0 not ugpraded". Try it again after the next kernel update is issued. –  Scaine Aug 17 '10 at 11:18
2  
autoremove won't remove old kernel versions; it only gets rid of things that were installed as dependencies that are no longer needed. –  ImaginaryRobots Feb 6 '11 at 18:50
    
Ah, okay. But then... that includes old kernels, at least on my system. Are there circumstances where old kernels still have dependencies somehow? –  Scaine Feb 6 '11 at 19:35
    
Two votes up, then bizarrely two votes down. So I've added proof that old kernels are easily removed with one command, despite ImaginaryRobots claim otherwise (which itself got two votes for!). I'm not sure if I'm missing a point here? Have I completely got the wrong end of the stick?? –  Scaine Mar 6 '11 at 21:06
show 4 more comments

Daniel Richter has developed a GUI configuration tool to allow users to change the Grub 2 settings without using the command line. The application allows the user to add, remove, freeze, rename and reorder boot menu items. It will also allow changes to the Grub 2 configuration settings such as background image and menu timeout.

you can use it and install it follow this GUIDE

if you want deep in GRUB 2 you can read this GUIDE too

so thx to DANIEL

share|improve this answer
add comment

Personally I use the following setup (grub legacy):

title      Ubuntu 10.10 Maverick Meerkat, latest kernel
uuid       ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf
kernel     /vmlinuz ro quiet splash root=UUID=ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf resume=UUID=51ac47a8-6372-4edf-a5a8-be8e5bc13cca
initrd     /initrd.img
savedefault

title      Ubuntu 10.10 Maverick Meerkat, latest kernel in recovery mode
uuid       ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf
kernel     /vmlinuz ro single root=UUID=ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf noresume
initrd     /initrd.img

title      Ubuntu 10.10 Maverick Meerkat, previous kernel
uuid       ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf
kernel     /vmlinuz.old ro quiet splash root=UUID=ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf resume=UUID=51ac47a8-6372-4edf-a5a8-be8e5bc13cca
initrd     /initrd.img.old
savedefault

title      Ubuntu 10.10 Maverick Meerkat, previous kernel in recovery mode
uuid       ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf
kernel     /vmlinuz.old ro single root=UUID=ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf noresume
initrd     /initrd.img.old

title      Memory test
uuid       ab0d6ed0-ecbc-4718-be12-cbb3955c1aaf
kernel     /boot/memtest86+.bin

### BEGIN AUTOMAGIC KERNELS LIST
## ## Start Default Options ##
# howmany=0
# memtest86=false
## ## End Default Options ##
### END DEBIAN AUTOMAGIC KERNELS LIST

This works because Ubuntu automatically updates /vmlinuz, /initrd.img symlinks to point to latest installed kernel and initramfs image (and .old companions to point to previous ones).

This will not work with /boot on separate partition though.


I can't understand why Ubuntu doesn't use this by default and constructs unbearably ugly and crutchful workarounds which fill bootloader screen with excessively redundant and useless lines. In my opinion, the screen should look at least like this:

Ubuntu, latest kernel
Ubuntu, latest kernel in recovery mode
Ubuntu, previous kernel
Ubuntu, previous kernel in recovery mode
Gentoo
Windows 7 (loader)
<everything you have...>
------------------------
Memory test

The four Ubuntu lines already feel redundant. Now imagine a dozen of almost-the-same lines which differ in some digits only (and all mean just "boot Ubuntu"!) — and you have to select the proper one. Nightmare!

share|improve this answer
    
Nice, although I can't comment on it technically - I don't know enough about Grub (or Grub 2). That looks very slick though. –  Scaine Feb 6 '11 at 19:38
    
@Scaine except for hardcoded UUIDs, everything should be pretty robust. –  ulidtko Feb 6 '11 at 21:07
add comment

Well, Ubuntu Tweak has a nice simple interface for killing old images and headers and all. Seems to me to be simple enough to be foolproof. Crappy quick and dirty screenshot. It will autopopulate and not show anything related to the current kernal. Not associated with the project, but it's worked well for me in the past.

share|improve this answer
1  
+1, a very nice solution, I hope others will vote up! –  Neil Trodden Nov 13 '10 at 21:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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