cleaning old kernels

Discussion in 'all things UNIX' started by cet, Sep 28, 2010.

Thread Status:
Not open for further replies.
  1. cet

    cet Registered Member

    Joined:
    Sep 3, 2006
    Posts:
    867
    Location:
    Turkey/İzmir
    I have too many kernels in the Grub menu.Since I am using the latest one without any problems I would like to remove some of them.What is the safest way to remove those?
    I have 26.32.21
    26.32.22
    26.32.23
    26.32.24
    and the one I am booting to:26.32.25

    Should I leave the first one and the latest two?
    If I use synaptic I see 3 entries for 26.32.22 which are linux headers and linux headers generic and linux image,do I have to remove all three for 1 kernel?

    Maybe I should install and use ubuntu tweak?
    Computer janitor only shows 26.32.21 for removal.
     
  2. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,677
    Location:
    George, S.Africa
    You remove them in Synaptic. Enter in quick find the number for the kernel you want to remove eg.2.6.32-23
    Then proceed as follows:

    Find the "linux-image" and "linux-headers" files for the applicable kernel (example - linux-image-2.6.32-23 or "linux-image-2.6.32-23-generic).
    Right click and select "Mark for Complete Removal" and then press the Apply main menu button.
    The kernels will be removed from your system and from the Grub menu.
    If you are not sure of the kernel you are currently using, in a terminal type "uname -r".
    Grub will be updated automatically no need to run update-grub.

    Those marked green in my sshot are the ones to remove. It's only to show you, I always keep the last 2 i.e. 2.6.32-24 and of course the latest one 2.6.32-25

    kernel delete.png
     
  3. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    i used to keep 2 or 3 kernels rest i uninstall they help me to boot many times when i messed with fedora in latest kernel mode.

    like ocky said its best to keep atleast 2 kernels :)
     
  4. cet

    cet Registered Member

    Joined:
    Sep 3, 2006
    Posts:
    867
    Location:
    Turkey/İzmir
    Thanks I removed the 2.6.32.22 and 2.6.32.23 kernels.Everything is working fine.
     
  5. zapjb

    zapjb Registered Member

    Joined:
    Nov 15, 2005
    Posts:
    3,518
    Location:
    USA - Back in a real State in time for a real Pres
    I once installed an unstable kernel (on my hardware anyways) & deleted the older kernel right away. Big mistake. Now I run the newer kernel & keep the older kernel for a while. Then everything being OK with the newer kernel. Then I uninstall the older kernel. :)
     
  6. katio

    katio Guest

    sudo apt-get autoremove

    that's it :)
     
  7. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    If in Ubuntu, use Ubuntu-Tweak to clean them safely with GUI.
     
  8. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    one way like ocky said second easy and best way which cleans kernel related files as well is ubuntu tweak which linux for all already mentioned
     

    Attached Files:

  9. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,677
    Location:
    George, S.Africa
    My boot screen - only 2 kernels. Excuse lousy image quality.

    Boot screen.jpg
     
  10. cet

    cet Registered Member

    Joined:
    Sep 3, 2006
    Posts:
    867
    Location:
    Turkey/İzmir
    I would like to install ubuntu tweak,as I see most of you are using that program.Since it is not in the ubuntu software center should I add the repository from its home page as:sudo add-apt-repository ppa:tualatrix/ppa

    or should I install the latest deb from the home page.
     
  11. mack_guy911

    mack_guy911 Registered Member

    Joined:
    Mar 21, 2007
    Posts:
    2,677
    i use ppa


    but do not all download all type software that given in ubuntu tweak only few knows ones like skype...google chrome ..etc also added their ppa
     
  12. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,136
    Cet, ppa is a better idea as it will keep it updated to the latest automatically.
     
Loading...
Thread Status:
Not open for further replies.