grub2, dual boot: i get a lot of items, lot of old kernels are installed, how to remove ?

Asked by Francisco Trinidad

I am running Ubuntu and windows 7, at start up appear:
Ubuntu, with Linux 2.6.32-32 Generic Pae
Ubuntu, with Linux 2.6.32-32 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-31 Generic Pae
Ubuntu, with Linux 2.6.32-31 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-30 Generic Pae
Ubuntu, with Linux 2.6.32-30 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-29 Generic Pae
Ubuntu, with Linux 2.6.32-29 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-28 Generic Pae
Ubuntu, with Linux 2.6.32-28 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-27 Generic Pae
Ubuntu, with Linux 2.6.32-27 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-26 Generic Pae
Ubuntu, with Linux 2.6.32-26 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-25 Generic Pae
Ubuntu, with Linux 2.6.32-25 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-24 Generic Pae
Ubuntu, with Linux 2.6.32-24 Generic Pae (Recovery mode)
Ubuntu, with Linux 2.6.32-23 Generic Pae
Ubuntu, with Linux 2.6.32-23 Generic Pae (Recovery mode)
Memory test (memtest 86+)
Memory test (memtest 86+,serial console 115200)
Windows 7 (Loader) (on/dev/sda1)

What can I do to make short this list?
Some time ago somebody tell me something about to change Grub for other command but I lost the email.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
mano-மனோ
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Can you give the output of:

uname -a; lsb_release -a

Thanks

Revision history for this message
Francisco Trinidad (ft47) said :
#2

Linux pancho-desktop 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20
22:10:33 UTC 2011 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.2 LTS
Release: 10.04
Codename: lucid
pancho@pancho-desktop:~$

On Sun, 2011-06-26 at 23:21 +0000, actionparsnip wrote:
> Your question #162844 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/162844
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> Can you give the output of:
>
> uname -a; lsb_release -a
>
> Thanks
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

sudo apt-get --purge remove linux-image-2.6.32-30 linux-image-2.6.32-29 linux-image-2.6.32-28 linux-image-2.6.32-27 linux-image-2.6.32-26 linux-image-2.6.32-25 linux-image-2.6.32-24 linux-image-2.6.32-23; sudo apt-get --purge autoremove

Should leave you with linux-image-2.6.32-32 and linux-image-2.6.32-31 and will be a lot cleaner.

Revision history for this message
Francisco Trinidad (ft47) said :
#4

This is the message following the command

[sudo] password for pancho:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package linux-image-2.6.32-30
pancho@pancho-desktop:~$

and nothing change

On Mon, 2011-06-27 at 04:15 +0000, actionparsnip wrote:
> sudo apt-get --purge remove linux-image-2.6.32-30
> linux-image-2.6.32-29
> linux-image-2.6.32-28 linux-image-2.6.32-27 linux-image-2.6.32-26
> linux-
> image-2.6.32-25 linux-image-2.6.32-24 linux-image-2.6.32-23; sudo apt-
> get --purge autoremove

Revision history for this message
Francisco Trinidad (ft47) said :
#5

I dont understand what it means?

Thanks

On Mon, 2011-06-27 at 11:11 +0000, marcobra (Marco Braida) wrote:
> Your question #162844 on grub2 in Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/grub2/+question/162844
>
> Project: Ubuntu => grub2 in Ubuntu
>
> Summary changed to:
> grub2, dual boot: i get a lot of items, lot of old kernels are installed, how to remove ?
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

Ok can you give the output of:

dpkg -l | grep linux-image-2

Thanks

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#7

linux-image metapackages don't exist with specific version numbers (or at least not in all releases), and even the linux-image metapackages that do exist are not always installed. So you have to remove the packages that actually provide the kernels that are installed. In this case (since these are PAE kernels):

sudo apt-get purge linux-image-generic-pae-2.6.32-30 linux-image-generic-pae-2.6.32-29 linux-image-generic-pae-2.6.32-28 linux-image-generic-pae-2.6.32-27 linux-image-generic-pae-2.6.32-26 linux-image-generic-pae-2.6.32-25 linux-image-generic-pae-2.6.32-24 linux-image-generic-pae-2.6.32-23; sudo apt-get --purge autoremove

If somehow that doesn't work, please when you reply please do include the output of the dpkg command actionparsnip just posted--that will reveal the names of the proper packages for uninstallation (but will also show packages that should not be uninstalled, so please don't just remove all the listed packages, unless you know what you're doing).

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#8

By the way, you can also remove old kernels in the Synaptic Package Manager (this is perhaps the easiest way to do it, especially if you don't know what they're called ahead of time), or (usually) with the Computer Janitor.

Revision history for this message
Best mano-மனோ (manoj-neyveli) said :
#9

Download and install Ubuntu tweak
http://launchpad.net/ubuntu-tweak/0.5.x/0.5.14/+download/ubuntu-tweak_0.5.14-1~maverick1_all.deb
Application>system tools>Ubuntu tweak
Open it and click Package Cleaner
Click Unlock button and type password
Then on the right click Clean Kernels
Now select and delete unwanted kernels.

Revision history for this message
Francisco Trinidad (ft47) said :
#10

pancho@pancho-desktop:~$ dpkg -l | grep linux-image-2
ii linux-image-2.6.32-23-generic-pae 2.6.32-23.37
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-24-generic-pae 2.6.32-24.43
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-25-generic-pae 2.6.32-25.45
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-26-generic-pae 2.6.32-26.48
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-27-generic-pae 2.6.32-27.49
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-28-generic-pae 2.6.32-28.55
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-29-generic-pae 2.6.32-29.58
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-30-generic-pae 2.6.32-30.59
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-31-generic-pae 2.6.32-31.61
Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-32-generic-pae 2.6.32-32.62
Linux kernel image for version 2.6.32 on x86
pancho@pancho-desktop:~$

On Mon, 2011-06-27 at 14:41 +0000, actionparsnip wrote:
> dpkg -l | grep linux-image-2

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

Please try this:

sudo apt-get --purge remove linux-image-2.6.32-{23,24,25,26,27,28,29,30}-generic-pae
sudo apt-get --purge autoremove

Revision history for this message
Francisco Trinidad (ft47) said :
#12

Thank you very much

My list now is very short and clean

Again Thanks

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#13

nice command dude :)

Revision history for this message
mano-மனோ (manoj-neyveli) said :
#14

Welcome And Thanks