• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Removing kernel

 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm currently using Linux Mint 12 (64 bit) and having several kernels installed. They also show up in grub menu and I'm able to successfully boot into each of them.

Now, I want to remove a kernel. Is there any procedure for it?

As far as I know, initrd image, system map and vmlinuz image for that specific kernel and fire update-grub. Is that enough? Or any better options?

Thanks in advance.
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I got how to do it.

For system installed kernels (installed via apt-get):
1) Make a list of installed kernels:
$ dpkg --get-selections | grep linux-image
2) Remove the kernel:
$ sudo apt-get purge <kernel_to_remove>

For manually installed kernels:
Remove:
/boot/vmlinuz*KERNEL-VERSION*
/boot/initrd*KERNEL-VERSION*
/boot/System-map*KERNEL-VERSION*
/boot/config-*KERNEL-VERSION*
/lib/modules/*KERNEL-VERSION*/

Since I'm not using rpm based distro, I haven't searched about it yet.

The most important thing:
1) After all cleaning up the kernels, you must update the boot-loader before rebooting the system.
i.e. $ sudo update-grub
in case of grub boot-loader. Not sure how to update LILO.
2) Do not do these operations on current kernel you've booted into. If you want to remove a specific kernel, boot into any other kernel than that.

Hope this helps.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If all that you wanted to do was to reduce the size of your boot menu, then removing the /boot/vmlinuz*KERNEL-VERSION* file(s) would be sufficient. I usually monitor my Linux updates and when it wants to install a new kernel, I rename the prior kernel (I usually have 2 kernels in by boot menu, the current one I am running and the prior kernel) /boot/vmlinuzXXX file so that when the grub update runs only the current and new kernel get added to the boot menu. By renaming, all of the old kernels are still there and available, and then don't take up that much space, and besides disk is still relatively cheap.
reply
    Bookmark Topic Watch Topic
  • New Topic