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.

I installed a pae kernel on my Ubuntu 12.04 32-bit box in order to try it (I thought I would add RAM to my computer which I finaly didn't).

It automatically added an entry to grub's boot menu with the pae kernel, which is now the default one.

Now I don't use it any more (just gave it a try). Now every time I boot, I select "previous linux versions" in the boot menu, and then in the submenu I choose the first entry, which used to be the default one prior to installing the PAE kernel.

Now if I uninstall the kernel with apt-get remove (as I installed it with apt-get install), I obviously expect it to leave everything the way it was before: i.e., remove the corresponding item in the boot menu and restore the old one as the default.

The question is: will it do that? I want to be sure that I won't end up with an unbootable machine with an entry in the boot menu for a kernel that is uninstalled, causing grup to freak out or something, or (less disastrous but still annoying) with a useless entry in the boot menu obliging me to choose the right option every time forever as I do now (or to manually reconfigure grup).

share|improve this question

1 Answer 1

For sure you can apt-get remove kernel that is not in use. To be sure that you're removing right version - you can type dpkg -l |grep kernel in order to find full package name from list and apt-get remove exactly that package.

Unfortunately I don't know if in ubuntu it will automatically edit for you menu.lst or not, in case if not, you will need to cd /boot/grub and edit menu.lst by yourself.

Just open it in your favorit editor, find the line with "uninstalled" kernel and remove entire block, or just check which number is kernel that you want to boot and change parameter default 0 with default N (where N starts from 0 and its number of kernel that you want to default boot)

share|improve this answer
    
Thanks. It certainly edited the menu when I installed it. I guess that is not a guarantee that it will edit it back when uninstalled, right? Let's suppose it won't (so the boot menu would have a "dead" entry which certainly can't boot). Would that prevent even other, sane, entries in the menu from working? (that is, would it prevent grub itself from properly showing the menu in the first place?) –  matteo Dec 13 '12 at 23:28
    
D'Oh! There's no "menu.lst" in /boot/grub: /boot/grub/command.lst /boot/grub/crypto.lst /boot/grub/fs.lst /boot/grub/moddep.lst /boot/grub/partmap.lst /boot/grub/parttool.lst /boot/grub/terminal.lst /boot/grub/video.lst –  matteo Dec 13 '12 at 23:31
    
Yes in new version of ubuntu they are using grub2 and not grub. grub2 is not using menu.lst anylonger, after uninstalling kernel, you just need to run sudo update-grub it will regenerate grub.cfg. –  NauT Dec 14 '12 at 15:57

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.