How to delete old kernel safely?

Discussion in 'Linux' started by morningching, Dec 25, 2009.

  1. morningching

    morningching

    Joined:
    Aug 4, 2008
    Messages:
    31
    Likes Received:
    0
    How can I delete old kernels safely? I have a long list of old kernels at boot up menu. I found a tutorial from website and I deleted them by un-checking through synaptic package manager, followed by update of grub. Old kernels have been removed but I got message "not found parent" at boot up. How to avoid this message. I am annoyed and I reinstalled many times.
    I use
    -ubuntu 9.10
    -grub2
     
    morningching, Dec 25, 2009
    #1
  2. morningching

    lotus49

    Joined:
    Jun 29, 2008
    Messages:
    343
    Likes Received:
    0
    Location:
    Yorkshire
    You can find out which kernel and header packages are installed by typing:

    Code:
    dpkg --get-selections |grep linux
    Select which ones you want to remove and type:

    Code:
    sudo apt-get purge <insert package names here>
    and you're away. Use the package names as reported by the first command; don't add the .deb extension.
     
    lotus49, Dec 27, 2009
    #2
  3. morningching

    libssd

    Joined:
    Jan 17, 2009
    Messages:
    244
    Likes Received:
    0
    Location:
    Atlanta, GA
    Thanks for the pointers. I notice that generally (not always) I'm seeing pairs like this:

    linux-headers-2.6.28-13
    linux-headers-2.6.28-13-generic

    Would the syntax be:

    sudo apt-get purge linux-headers-2.6.28-13
    sudo apt-get purge linux-headers-2.6.28-13-generic

    OR are wildcards permitted:

    sudo apt-get purge linux-headers-2.6.28-13*

    I also assume that as part of removing unneeded kernels, one would remove or comment out appropriate lines in the 9.04 grub config file, /boot/grub/menu.lst (which I've already done). I understand that 9.10 uses grub2, which is managed differently. Are there any gotchas?
     
    libssd, Dec 29, 2009
    #3
  4. morningching

    libssd

    Joined:
    Jan 17, 2009
    Messages:
    244
    Likes Received:
    0
    Location:
    Atlanta, GA
    Answering my own question, I went to the Ubuntu community, and learned to use Synaptic. Search for "linux-generic" and then search for "linux-headers". Mark the packages to be removed, and let her rip, leaving at least one or two earlier versions "just in case." This freed up about .75 gig of disk space -- not too shabby.
     
    libssd, Jan 6, 2010
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.