Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: old kernels removed but still in grub

  1. #1
    Join Date
    Jul 2006
    Beans
    26

    old kernels removed but still in grub

    This is just a housekeeping problem as my system is working fine. Whenever the kernels are updated it gets added to my grub2 menu. I remove the oldest ones via synaptic but some have lingered in grub's menu. When I search synaptic for a specific kernel(2.6.31-14 for instance) nothing comes up and ubuntu tweak has nothing either. I have tried the command line (there was a post for removing via the terminal but that did'nt work. I also deleted grub2 and reinstalled it but it added that old kernel back (as well as the others). Any ideas?

  2. #2
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: old kernels removed but still in grub

    Make sure both the kernel and header files are removed. You can do a search in synaptic for the specific kernel version (for instance 2.6.32-23) to see what still might be hanging around.

    You can also inspect /boot/grub/grub.cfg to see which script is finding the kernel (10_linux or 30_os-prober). If it's in the 30_os-prober section, Grub 2 may be finding an old menu list or grub.cfg in another partition. In that case, you would need to find the file which contains the entry and either edit it or delete it, or find the kernel which still may be residing in another partition.
    Back to Xorg...

    Retired.

  3. #3
    Join Date
    Mar 2008
    Location
    Texas
    Beans
    391
    Distro
    Lubuntu 18.04 Bionic Beaver

    Re: old kernels removed but still in grub

    In the terminal,use..
    Code:
    sudo apt-get remove --purge X.X.XX-X-*
    where X is the Kernel you want to remove,the * is the wildcard and will pull both kernel and header files and drop it from the grub list
    note....keep the "2" most recent kernels, so that you have an extra known good kernel to boot from

  4. #4
    Join Date
    Jul 2006
    Beans
    26

    Re: old kernels removed but still in grub

    Quote Originally Posted by ssulaco View Post
    In the terminal,use..
    Code:
    sudo apt-get remove --purge X.X.XX-X-*
    where X is the Kernel you want to remove,the * is the wildcard and will pull both kernel and header files and drop it from the grub list
    note....keep the "2" most recent kernels, so that you have an extra known good kernel to boot from
    Hi, Thanks but this is what happens :
    =@angry1:~$ sudo apt-get remove --purge 2.6.31-14
    [sudo] password =:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package 2.6.31-14
    @angry1:~$

    My mistake, I tried it with the wildcard but same result.
    Last edited by dfor50; August 29th, 2010 at 05:27 AM.

  5. #5
    Join Date
    Jul 2006
    Beans
    26

    Re: old kernels removed but still in grub

    Thanks drs305, it looks like 10_linux is finding the file :

    menuentry 'Ubuntu, with Linux 2.6.31-14-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 3553854e-edd2-4ffc-b4a2-0d1cb482c99b
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=3553854e-edd2-4ffc-b4a2-0d1cb482c99b ro quiet splash
    initrd /boot/initrd.img-2.6.31-14-generic

    }
    menuentry 'Ubuntu, with Linux 2.6.31-14-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 3553854e-edd2-4ffc-b4a2-0d1cb482c99b
    echo 'Loading Linux 2.6.31-14-generic ...'
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=3553854e-edd2-4ffc-b4a2-0d1cb482c99b ro single
    echo 'Loading initial ramdisk ...'
    initrd /boot/initrd.img-2.6.31-14-generic
    }

    Is there anything I can do?

  6. #6
    Join Date
    Apr 2006
    Location
    Rochester, N.Y.
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: old kernels removed but still in grub

    Silly question but have you tried terminal
    Code:
    sudo update-grub2
    Also, any other partitions on your machine?
    Just a thought.
    (Was)Windows Free At Last
    "May You Have A Safe Trip and A Successful Journey"
    Linux user #432153 Ubuntu user #8521

  7. #7
    Join Date
    Jul 2006
    Beans
    26

    Re: old kernels removed but still in grub

    Quote Originally Posted by DougieFresh4U View Post
    Silly question but have you tried terminal
    Code:
    sudo update-grub2
    Also, any other partitions on your machine?
    Just a thought.
    Hi,
    I tried it again..........
    @angry1:~$ sudo update-grub2
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-2.6.32-24-generic
    Found initrd image: /boot/initrd.img-2.6.32-24-generic
    Found linux image: /boot/vmlinuz-2.6.31-21-generic
    Found initrd image: /boot/initrd.img-2.6.31-21-generic
    Found linux image: /boot/vmlinuz-2.6.31-20-generic
    Found initrd image: /boot/initrd.img-2.6.31-20-generic
    Found linux image: /boot/vmlinuz-2.6.31-19-generic
    Found initrd image: /boot/initrd.img-2.6.31-19-generic
    Found linux image: /boot/vmlinuz-2.6.31-14-generic
    Found initrd image: /boot/initrd.img-2.6.31-14-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows 7 (loader) on /dev/sda1
    Found Windows 7 (loader) on /dev/sdc1
    Found Ubuntu 10.04 LTS (10.04) on /dev/sdc5
    done
    @angry1:~$


    I appreciate any help DougieFresh4U. It will end up being some dumb thing I've done or haven't done.

  8. #8
    Join Date
    Aug 2006
    Location
    Göteborg, Sweden
    Beans
    317

    Re: old kernels removed but still in grub

    I don't have a clear picture of how you tried to remove the kernels... Did you launch Synaptic, browse through the unfiltered list ('All') to 'linux-', or just search for the specific kernel image and remove that? You know, there are a ton of headers and metapackages and things you'll want to clean out besides the image...

    My method when moving from one kernel to the other is to, as I mentioned above, launch Synaptic, without any filter whatsoever moving down to 'linux' (clicking in that pane and typing 'linu' is often enough in my case). Once there, I go through the list carefully and look for entries mentioning the undesired kernel-version (linux-kernel-headers, linux-lbm, linux-kernel-image -generic this and that). Yep, it does take a few minutes every time, and the removal kicks mkinitrd into action a few times - depending on how much I'm removing - as well as update-grub, so mind that you don't attempt this when you have to catch a bus or something...

  9. #9
    Join Date
    Mar 2008
    Location
    Texas
    Beans
    391
    Distro
    Lubuntu 18.04 Bionic Beaver

    Re: old kernels removed but still in grub

    Quote Originally Posted by dfor50 View Post
    Hi, Thanks but this is what happens :
    =@angry1:~$ sudo apt-get remove --purge 2.6.31-14
    [sudo] password =:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package 2.6.31-14
    @angry1:~$

    My mistake, I tried it with the wildcard but same result.
    did you add the hyphen at the end followed by the asterisk,
    retry with sudo apt-get remove --purge 2.6.31-14-*
    Last edited by ssulaco; August 29th, 2010 at 12:11 PM.

  10. #10
    Join Date
    Jul 2006
    Beans
    26

    Re: old kernels removed but still in grub

    Hi ssulaco,

    Tried it then:

    @angry1:~$ sudo apt-get remove --purge 2.6.31-14-*
    [sudo] password for :
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package 2.6.31-14-*
    @angry1:~$

    Same result.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •