Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For instance, my boot menu has three kernel versions, each with a recovery option. Are these extra options for debugging and troubleshooting?

share|improve this question
4  
Because they break things. (LOL) –  Shiki Mar 23 '11 at 20:05
1  
FWIW, this only applies to some Linux distributions (e.g. Debian-based). You mention in a comment that you are planning to switch to Arch; it in particular has only one package, kernel26, containing the latest version. –  grawity Mar 23 '11 at 20:14
    
On Arch... I don't know how, or why, but I received an update. It was i386 ..regarding some core stuff. I had an x86-64 installed. Thought its for cross-libs or something. Next reboot? No good. Tried using livecd + chroot (didnt work), cross installing from livecd with pacman. It was totally dead. || In short. HUGE + for the backup stuff. This applies to Arch even more! –  Shiki Mar 23 '11 at 20:35

2 Answers 2

up vote 7 down vote accepted

After a new kernel is installed, there's no guarantee that the new one will work flawlessly due to the heavily fragmented realm of Linux. Therefore the boot menu will offer the possibility to easily boot to the previous kernel. Earlier kernels can easily be deleted or simply removed from the boot menu.

And yes, it's also used for debugging purposes by, say, developers.

Completely removing an old kernel, an example

For the example I'll be using an Ubuntu/Debian machine. Make sure your new kernel works properly and is compatible with your current install before doing this. First we need to list which kernels are installed, so open up a terminal window, and execute:

dpkg --list 'linux-image*'

this should output something similar to the below

||/ Name                          Version                       Description
+++-=============================-=============================-==========================================================================
ii  linux-image                   2.6.22.14.21                  Generic Linux kernel image.
un  linux-image-2.6                                       (no description available)
rc  linux-image-2.6.20-15-generic 2.6.20-15.27                  Linux kernel image for version 2.6.20 on x86/x86_64
ii  linux-image-2.6.20-16-generic 2.6.20-16.32                  Linux kernel image for version 2.6.20 on x86/x86_64
ii  linux-image-2.6.22-14-generic 2.6.22-14.47                  Linux kernel image for version 2.6.22 on x86/x86_64
ii  linux-image-generic           2.6.22.14.21                  Generic Linux kernel image

Now we've got a list of installed kernels, we can simply remove the kernel by invoking the package management. Say, we want to delete the 2.6.22-14-generic kernel, we execute:

sudo apt-get remove linux-image-2.6.22-14-generic

You may need to enter your credentials and after that your selected kernel will me removed permanently. If it's still present in the boot list (GRUB), execute the following command in the terminal:

sudo update-grub
share|improve this answer
    
Thank you. This is a very detailed answer. Would it be wise to remove the old kernels? I'm preparing to move to Arch right now. Should I keep one old version as a fallback? –  Tasuret Mar 23 '11 at 20:11
    
It is wise to keep 1-2. If you confirm that the new one works perfect and you REALLY in an urgent need of space, you can remove the old ones. –  Shiki Mar 23 '11 at 20:12
    
@Tasuret I always keep one version below the current one, just in case. So I always have a back up. Since there's a fair amount between the updates, you'll probably know if the new version works for you before a new update comes out. So if I'm using v3, I'll have v2 on backup, etc. –  BloodPhilia Mar 23 '11 at 20:13
1  
The consensus seems to be that backups are a good thing to have. –  Tasuret Mar 23 '11 at 20:15
    
@Tasuret Always! ;) If it doesn't help you at some point, it wouldn't have hurt you either! –  BloodPhilia Mar 23 '11 at 20:16

When you update to a new kernel version, the older ones are generally left there in case the new kernel breaks something.

You don't mention your distro, but here's an example way to clear them: http://www.cyberciti.biz/faq/proper-way-to-remove-old-linux-kernels/

share|improve this answer

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.