0

Possible Duplicate:
Is there a way to remove/hide old kernel versions?

I installed Ubuntu Tweak in Ubuntu 11.10, went to Janitor, and selected and removed old kernels that appeared there (3.0.0-12). Now, the only installed linux-image that appears as 'Installed' in SPM is the most recent one (3.0.0-13), which is the one I want. It did not however eliminate the kernel listing in Grub 2. At boot:

However, at boot, in Grub-2, the following options still appear:

3.0.0-13-generic 3.0.0-13-generic (recovery mode) 3.0.0-12 (generic) (on /dev/sde5) 3.0.0-12 (generic (recovery mode) (on /dev/sde5)

And, in Terminal, when I change directory (cd) to /boot, and then list (ls), I get the following listed kernels:

3.0.0-13 2.6.38-12 2.6.38-8

(al

There is no change when I sudo update-grub in Terminal

1) what is /dev/sde5, and where is it located in the file system, so i can delete it? 2) why the differences between what appears as installed in SPM, what appears at boot in Grub2, and what shows when I list the contents of Grub2 in Terminal? Ultimately, I simply want to remove the 3.0.0-12 kernel options at boot in Grub2. How do I best and simplest do that? Thanks again donofrij is online now Report Post Edit/Delete Message Reply With Quote Multi-Quote This Message Quick reply to this message

user12809
  • 129
  • I presume /dev/sde5 is a removable device or flash driver ? Remove it and re-run sudo update-grub . Sorry I sort of went a little overboard and typed a long answer without reading your post :redface: – Panther Dec 09 '11 at 01:29

1 Answers1

0

The best way, IMO, is to remove old kernels you do not use. You should always keep at least one old, working kernel "just in case".

You can remove old kernels from the software center, synaptic, or the command line.

You can also remove them with ubuntu-tweak

sudo apt-get install ubuntu-tweak

Run ubuntu-tweak, and

  1. Select "Package Cleaner" on the left and ""Clean Kernel" from the right panel.
  2. Press the "Unlock" button at the lower right, enter your password.
  3. Select from the displayed list the kernel images and headers you wish to remove. The kernel in use is not listed.
  4. Press the "Cleanup" button at the lower right to remove the selected kernel images and headers.

source: http://ubuntuforums.org/showpost.php?p=9920974&postcount=1

Or if you want a geeky command

Dry run

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove

If the package list looks "good to go" (no pun intended =) )

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge

Detailed explanation of those commands

If you do not remove them, and elect to edit grub, the old kernel will be added back with kernel (grub) updates.

Panther
  • 102,067