How to Hide Old Kernels in Grub's Boot Menu
Carrie Webb: This one is from Cliff Haynes.
Robbie Ferguson: Hey, Cliff.
Carrie Webb: “This past week has been fun”
Robbie Ferguson: Keep it clean, Cliff.
Carrie Webb: Not really. A locked up windows and how to reformat it four times needless to say Ubuntu also went out the window as well. I had most the important stuff backed up on another machine, just the aggravation of being a “newbie” as always. Lol. Here’s the problem sign screen script and maybe you can pull this one up Robbie in just giving you some detail?”
Robbie Ferguson: Surely.
Carrie Webb: He wants to know did he manage to get the information that you all see there.
Robbie Ferguson: Okay. We’re looking at the grub boot screen. All right we’re looking at Clifford Haynes email here.
Okay. So Clifford has got some updates on his computer snd when he turns on his computer, he’s greeted with all the Kernels like this. Way to go for actually typing that in for me.
“How did I manage to get that? It doesn’t make any difference which line of Ubuntu I used. They all seem to work, etcetera, and etcetera. Right down at the desktop, Windows boots up fine so does Ubuntu. The system is a compact Presario.” So the rest of it, what’s happened there is that you’ve run an update and you’ve got the latest version of your Kernel.
So, you’ll see here that the first one, okay? Recovery mode is like your command prompt. So that if you ever have a mess up, you want to have recovery mode because it lets you access the computer. You’ll see the Kernel version here.
The Kernel version of the first one on the list is 2.6.24-19-generic. Then you see the next one up from that is -22-generic. So what’s happened there is that you’ve run your updates and Ubuntu has given you the latest Kernel. So, all that’s happening is that your old Kernel is still being displayed on the grub menu when you first turn on your computer.
So, in your case, if you want to get rid of that, you don’t want to run the old Kernel if the new Kernel’s working for you it’s still there so that you can if you need to. But essentially all your stuff is updated so you want to be able to use the latest version of the Kernel.
So, it’s actually what you need to do if you want to only show one Kernel is using the how many command in your “grub menu.list” file. Where are we going to do that? Let’s see. We’re just going to hit Alt+F2 as the quick GY way to do it. Alt+F2 brings up a run dialogue where we can go, “gksudo gedit /boot/grub/menu.list”. Let’s try that one first. It’s going to ask you for password because we used GKSUDO. That’s going to bring up GEDIT.
I always get confused with synaptic pack list. Let’s see what happens here. Oh, there’s that grey old thing. I guess it is loading. Firstly, my demo system is this is one of the things that eventually want to upgrade Carrie because the demo system running the virtual machine right now and it’s really not suited up for that.
Carrie Webb: Okay. So what’s the gray up mean for you?
Robbie Ferguson: That’s when the system is out of resources and it’s waiting to. Let’s just double check. I think it’s just okay. So yeah, so leave out the “I” in “list”. That should have been “menu.lst” and once that’s up, then you’re going to see your grub boot file. You see here, you can scroll through and read the comments if you like and learn a little bit about grub. I’m sure it’s in here. Yeah.
There are “##=All”. Take that “##=All”. Remove the number sign at the beginning which makes it a comment and change that to “1” and once you’ve done that, save the file, remember that you have done this with GKSUDO or SUDO if you’re in the terminal otherwise you’re not going to be allowed access to save in this file.
So, “##=1” is going to only show one Kernel version when you boot your computer. Once you’ve done that, you need to run “sudo update-grub” from your terminal. And what that’s going to do is it’s going to update your grub menu and then next time you boot up, you should only have one. And that’s going to continue on.
So, as you get a new updates and new updates and new updates to your system, you’re going to only see one Kernel even if it’s the newer version. That should work for you. And as I always say, let us know.
Carrie Webb: Great.
Transcription by:
Scribe4you Transcription Services