grub 2

Asked by j3lc

Grub 2 work just fine but i want to ask if there is a way i can minimize the kernel lines. They keep increasing every time there is an update. I want only the latest to be shown on boot menu

Question information

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

The increasing of lines are simply the installed Kernels. So please remove old kernels keep actual + the latest working kernel.

If you want help please copy and paste here the result of this terminal command:

Open a Terminal from the menu Applications → Accessories → Terminal and type:

Suggestion: right click with mouse on the terminal title caption and select the item "Always on Top" doing this you will force the terminal window to stay on top of the other windows and you will find very easy to copy single row from this web page into the terminal...

(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

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

copy and paste result here...

Thank you

Revision history for this message
j3lc (j3lc) said :
#2

ii linux-image-2.6.28-11-generic 2.6.28-11.42 Linux kernel image for version 2.6.28 on x86
ii linux-image-2.6.28-12-generic 2.6.28-12.43 Linux kernel image for version 2.6.28 on x86
ii linux-image-2.6.28-13-generic 2.6.28-13.45 Linux kernel image for version 2.6.28 on x86
ii linux-image-2.6.28-14-generic 2.6.28-14.47 Linux kernel image for version 2.6.28 on x86
ii linux-image-2.6.28-15-generic 2.6.28-15.49 Linux kernel image for version 2.6.28 on x86
ii linux-image-generic 2.6.28.15.20 Generic Linux kernel image

Revision history for this message
j3lc (j3lc) said :
#3

How do i remove old kernels? With the old grub i could configure (in the menu.lst) to display only one kernel

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

Open a Terminal from the menu Applications->Accessories->Terminal

Tip: right click with mouse on the terminal title caption and select the item "Always on Top" doing this you will force the terminal window to stay on top of the other windows and you will find very easy to copy single row from this web page into the terminal...
Something more about using the terminal https://help.ubuntu.com/community/UsingTheTerminal

Then type or better copy and paste a row a time then press enter:
(Tip: select the single row to copy then right click into the terminal and to quick paste click with middle button of mouse )

sudo aptitude purge linux-image-2.6.28-11-generic linux-headers-2.6.28-11-generic linux-headers-2.6.28-11
sudo aptitude purge linux-image-2.6.28-12-generic linux-headers-2.6.28-12-generic linux-headers-2.6.28-12
sudo aptitude purge linux-image-2.6.28-13-generic linux-headers-2.6.28-13-generic linux-headers-2.6.28-13
sudo aptitude purge linux-image-2.6.28-14-generic linux-headers-2.6.28-14-generic linux-headers-2.6.28-14
sudo aptitude purge linux-image-2.6.28-15-generic linux-headers-2.6.28-15-generic linux-headers-2.6.28-15

Then please also read https://answers.launchpad.net/ubuntu/+source/grub/+question/49058

Hope this helps

Revision history for this message
j3lc (j3lc) said :
#5

That solves the problem with lots of kernels but is there a way kernels to be minimized to a specific number automatically and not manually. If you can answer the second part i would be grateful but even if you can't just let me know and i will press "this solved my problem"

Revision history for this message
Felix Zielcke (fzielcke) said :
#6

No there is no way to configure the maximum kernels.
You would need to modify /etc/grub.d/10_linux yourself to implement this

Revision history for this message
j3lc (j3lc) said :
#7

Thanks marcobra (Marco Braida), that solved my question.