Editing GRUB problem

Asked by EthanH

I'm wonder does anyone know how to edit GRUB list when the computer boot up. I'm trying to delete some line in it because when it boot up, it show me this boot option.

Ubuntu, kernel 2.6.15-27
Ubuntu, kernel 2.6.15-27 (safe mode)
Ubuntu, kernel 2.6.15-27
Ubuntu, kernel 2.6.15-27 (safe mode)
Ubuntu, memtest86+
Microsoft Window XP Home edition

I want to get rid the two of them which are top of Ubuntu, memtest86+ (not the first 2)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
EthanH
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Here https://answers.launchpad.net/ubuntu/+source/grub/ you will find more about grub

Please don't modify GRUB by hands simply try to remove unused installed kernels

To get the installed kernels on your pc please open a terminal and type:

dpkg -l | grep -i linux-image | grep -i ii

Copy and paste result here...

Revision history for this message
EthanH (buggyboy79) said :
#2

Ok, i did what you ask. this is the result it give me.

ethan@ethan-desktop:~$ dpkg -l | grep -i linux-image | grep -i ii
ii linux-image-2.6.24-19-generic 2.6.24-19.41 Linux kernel image for version 2.6.24 on x86
ii linux-image-2.6.24-21-generic 2.6.24-21.42 Linux kernel image for version 2.6.24 on x86
ii linux-image-generic 2.6.24.21.23 Generic Linux kernel image
ethan@ethan-desktop:~$

o ya. i only got 1 linux OS, not 2

Revision history for this message
Sam_ (and-sam) said :
#3

Hi,
a) so called 'old' kernel images can be removed safely within Synaptic by clicking on the status button (left side corner)
## new kernel updates don't remove the old automatically, because if the new one doesn't work well you have an alternative to boot with.

b) in the menu.lst is an option #howmany, should be at least 2 for safety reasons.

section
### BEGIN AUTOMAGIC KERNELS LIST

Parameter
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

https://help.ubuntu.com/community/GrubHowto

Revision history for this message
EthanH (buggyboy79) said :
#4

Umm... can you clearify what are you saying?

Revision history for this message
EthanH (buggyboy79) said :
#5

Ok, where what my Grub menu look like:

Ubuntu 8.04.1, kernel 2.6.24-21-generic
Ubuntu 8.04.1, kernel 2.6.24-21-generic (recovery mode)
Ubuntu 8.04.1, kernel 2.6.24-19-generic <-----------------
Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode) <------------------
Ubuntu 8.04.1, memtest86+
Microsoft Windows XP Home Edition

i wanna get rid the one with the arrow, i dont have 2 linux OS on my computer

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#6

If your kernel is running fine you can remove old kernels... (they are not linux OS, they are kernels)

So open a terminal and type:

sudo apt-get --purge remove linux-image-2.6.24-19-generic
sudo apt-get autoremove

give your user password when requested, you don't see nothing when you type it, then press enter.

Then copy and paste here the result of this command:

dpkg -l | grep -i 2.6.24-19

Thank you

Revision history for this message
EthanH (buggyboy79) said :
#7

I got it. Thank you soo much marcobra.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#8

Ok but please give me the result of:

dpkg -l | grep -i 2.6.24-19

I think you must remove some remaining kernel related packages..

Thank you

Revision history for this message
EthanH (buggyboy79) said :
#9

ok, here is my result you told me to do.

ethan@ethan-desktop:~$ dpkg -l | grep -i 2.6.24-19
ii linux-headers-2.6.24-19 2.6.24-19.41 Header files related to Linux kernel version
ii linux-headers-2.6.24-19-generic 2.6.24-19.41 Linux kernel headers for version 2.6.24 on x
ethan@ethan-desktop:~$

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#10

ok please remove this packages...

sudo apt-get --purge remove linux-headers-2.6.24-19 linux-headers-2.6.24-19-generic
sudo apt-get autoremove

Hope this helps

Revision history for this message
EthanH (buggyboy79) said :
#11

ok, i did it. so here is the result. i hope i did it right.

ethan@ethan-desktop:~$ sudo apt-get --purge remove linux-headers-2.6.24-19 linux-headers-2.6.24-19-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-2.6.24-19* linux-headers-2.6.24-19-generic*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 68.3MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 111155 files and directories currently installed.)
Removing linux-headers-2.6.24-19-generic ...
Removing linux-headers-2.6.24-19 ...
ethan@ethan-desktop:~$

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#12

ok was fine...

Revision history for this message
EthanH (buggyboy79) said :
#13

lol, i forgot the sudo apt-get autoremove. but it still work.

Revision history for this message
Farhan (farh007) said :
#14

This is my actual booting scenario

Window 7
Ubuntu
Ubuntu

All working fine but how can i remove one of the Ubuntu option. Expertises please assist.

Tq