Results 1 to 6 of 6

Thread: Manually remove grub entries not in synaptic

  1. #1
    Join Date
    Apr 2011
    Beans
    8

    Manually remove grub entries not in synaptic

    Hi, I am running ubuntu 16.04, upgraded from 14.04, 13.10. The problem I have is there are old kernels left kicking around from I think 13.10 and are no longer in synaptic. I guess during one upgrade the kernels never got cleaned out. How can I manually remove these old kernels from grub and the OS? Before I start deleting files in the /boot directory I would like to ask someone more experienced then me so I don't mess something up. Attached is my boot directory showing the leftover 3.11 kernels I can't remove.

    boot_dir.jpg

  2. #2
    Join Date
    Jun 2016
    Beans
    2,824
    Distro
    Xubuntu

    Re: Manually remove grub entries not in synaptic

    Well you can double-check that those files don't belong to an installed package, and it's probably smart to do so. Run this command in a Terminal:
    Code:
    dpkg-query -S /boot/*3.11*
    For files that are *not* part of an installed package, it will output along these lines:
    Code:
    dpkg-query: no path found matching pattern <path>
    Also double-check that you're not running under a 3.11 kernel:
    Code:
    uname -a
    If all that turns out like expected, you can start removing these leftover files from /boot. (I would recommend you move them elsewhere instead of deleting them, so that you can put them back in case something goes wrong.)

    When all those files are no longer present in /boot, be sure to run
    Code:
    sudo update-grub
    And then reboot the computer to check that it worked.

    Hope this helps.
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  3. #3
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Manually remove grub entries not in synaptic

    What does the printout show when you run the update-grub command? In 16.04 this command will remove all old kernels and leave the 2 latest kernels.

    Code:
    sudo apt autoremove
    In earlier versions of Ubuntu the command is

    Code:
    sudo apt-get autoremove
    but it will only remove one kernel for every time it is run.

    Regards.
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  4. #4
    Join Date
    Apr 2011
    Beans
    8

    Re: Manually remove grub entries not in synaptic

    Thanks for the reply's. I ran the synaptic query you suggested and it has confirmed these kernels are no longer in the database. Here is the terminal output.

    apt_query.jpg

    I am running the latest 4.4 ubuntu kernel.

    When I run grub update, grub finds these kernels and they are added to the boot menu at boot up. Here is the output from that.

    grub-update.jpg

    I also ran apt-get autoremove and it did not find anything to remove.

    If it is safe to remove the 3.11 files from the /boot dir then I will give that a go. And I will move the files, not delete them, always good advice. Thanks!

  5. #5
    Join Date
    Jun 2016
    Beans
    2,824
    Distro
    Xubuntu

    Re: Manually remove grub entries not in synaptic

    You're welcome!
    Xubuntu 22.04, ArchLinux ♦ System76 hardware, virt-manager/KVM, VirtualBox
    If your questions are resolved to your satisfaction, please use Thread Tools > "Mark this thread as solved..."

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Manually remove grub entries not in synaptic

    You may want to check a couple of other places also, when dpkg housecleans it also removes from other locations:

    kernel house clean
    /usr/src/*
    http://askubuntu.com/questions/30146...an-i-stop-this


    Did you also check /var/cache/apt/archives? You may have the old .deb's taking up space.
    ls /usr/src
    ls /lib/modules
    ls /var/cache/apt/archives/linux-image*
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Tags for this Thread

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
  •