Results 1 to 10 of 10

Thread: Cleaning up Kernel installations

  1. #1
    Join Date
    May 2007
    Beans
    65
    Distro
    Ubuntu 9.10 Karmic Koala

    Question Cleaning up Kernel installations

    Hi, I've an installation of ubuntu 9.10 (well actually the corresponding mint but anyway...)

    I've been trying to find a way of clearing up clutter from my system. I noticed a huge bug (or rather nag) in the way the OS handles kernel upgrades. Instead of removing the previous versions of kernels from the system, it keeps them intact. My tiny 200MB ext2 /boot partition is all filled up.

    Is there any way to keep only the current kernel version and remove everything else ? Apt-get autoremove does not seem to do it.
    This signature does not exist

  2. #2
    Join Date
    Feb 2008
    Beans
    5,636

    Re: Cleaning up Kernel installations

    Open synaptic, search for linux-image. Keep the 1~2 latest ones and purge all the others.
    Don't forget to do a
    Code:
    sudo update-grub
    afterwards.

  3. #3
    Join Date
    Aug 2009
    Location
    Charleston, SC (USA)
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Cleaning up Kernel installations

    You can use a program called Ubuntu Tweak

    Or you can use Synaptic Package Manger (System-->Admin-->Synaptic) and remove the kernels by typing in their names into the quick search box. (kernel2.6.xx.xx or something similar)

    Run in a terminal the following command after removing the kernels via Synaptic
    Code:
    sudo update-grub
    Hope that helps,
    ~Caboose
    "When our actions do not, our fears do make us traitors." -- Shakespeare
    "Unless someone like you cares a whole awful lot, nothing is going to get better. It's not!" -- Dr. Seuss
    "No man has ever seen his dreams fulfilled and regretted the sacrifice necessary to fulfill them" -- Mattie Montgomery


  4. #4
    Join Date
    Oct 2004
    Location
    Denmark - Scandinavia
    Beans
    17,626

    Re: Cleaning up Kernel installations

    Moved to Other OS/Distro Talk forum.
    elementary OS Luna
    My Screenshot

  5. #5
    Join Date
    May 2007
    Beans
    65
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Cleaning up Kernel installations

    Ubuntu tweak does not seem to install.
    And synaptic shows only 1 version installed but a ls on my /boot says:

    Code:
    abi-2.6.31-11-rt          config-2.6.32-26-generic      System.map-2.6.31-11-rt       vmcoreinfo-2.6.32-27-generic
    abi-2.6.32-21-generic     config-2.6.32-27-generic      System.map-2.6.32-21-generic  vmcoreinfo-2.6.32-28-generic
    abi-2.6.32-23-generic     config-2.6.32-28-generic      System.map-2.6.32-23-generic  vmcoreinfo-2.6.32-30-generic
    abi-2.6.32-24-generic     config-2.6.32-30-generic      System.map-2.6.32-24-generic  vmlinuz-2.6.31-11-rt
    abi-2.6.32-25-generic     grub                          System.map-2.6.32-25-generic  vmlinuz-2.6.32-21-generic
    abi-2.6.32-26-generic     initrd.img-2.6.31-11-rt       System.map-2.6.32-26-generic  vmlinuz-2.6.32-23-generic
    abi-2.6.32-27-generic     initrd.img-2.6.32-21-generic  System.map-2.6.32-27-generic  vmlinuz-2.6.32-24-generic
    abi-2.6.32-28-generic     initrd.img-2.6.32-23-generic  System.map-2.6.32-28-generic  vmlinuz-2.6.32-25-generic
    abi-2.6.32-30-generic     initrd.img-2.6.32-24-generic  System.map-2.6.32-30-generic  vmlinuz-2.6.32-26-generic
    boot                      initrd.img-2.6.32-25-generic  vmcoreinfo-2.6.31-11-rt       vmlinuz-2.6.32-27-generic
    config-2.6.31-11-rt       initrd.img-2.6.32-26-generic  vmcoreinfo-2.6.32-21-generic  vmlinuz-2.6.32-28-generic
    config-2.6.32-21-generic  initrd.img-2.6.32-27-generic  vmcoreinfo-2.6.32-23-generic  vmlinuz-2.6.32-30-generic
    config-2.6.32-23-generic  initrd.img-2.6.32-28-generic  vmcoreinfo-2.6.32-24-generic
    config-2.6.32-24-generic  lost+found                    vmcoreinfo-2.6.32-25-generic
    config-2.6.32-25-generic  memtest86+.bin
    can I safely delete any of those ?
    This signature does not exist

  6. #6
    Join Date
    Aug 2009
    Location
    Charleston, SC (USA)
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Cleaning up Kernel installations

    Quote Originally Posted by MetalheadGautham View Post
    Ubuntu tweak does not seem to install.
    It must be because you are running a older version of Ubuntu...

    Quote Originally Posted by MetalheadGautham
    And synaptic shows only 1 version installed but a ls on my /boot says:

    Code:
    abi-2.6.31-11-rt          config-2.6.32-26-generic      System.map-2.6.31-11-rt       vmcoreinfo-2.6.32-27-generic
    abi-2.6.32-21-generic     config-2.6.32-27-generic      System.map-2.6.32-21-generic  vmcoreinfo-2.6.32-28-generic
    abi-2.6.32-23-generic     config-2.6.32-28-generic      System.map-2.6.32-23-generic  vmcoreinfo-2.6.32-30-generic
    abi-2.6.32-24-generic     config-2.6.32-30-generic      System.map-2.6.32-24-generic  vmlinuz-2.6.31-11-rt
    abi-2.6.32-25-generic     grub                          System.map-2.6.32-25-generic  vmlinuz-2.6.32-21-generic
    abi-2.6.32-26-generic     initrd.img-2.6.31-11-rt       System.map-2.6.32-26-generic  vmlinuz-2.6.32-23-generic
    abi-2.6.32-27-generic     initrd.img-2.6.32-21-generic  System.map-2.6.32-27-generic  vmlinuz-2.6.32-24-generic
    abi-2.6.32-28-generic     initrd.img-2.6.32-23-generic  System.map-2.6.32-28-generic  vmlinuz-2.6.32-25-generic
    abi-2.6.32-30-generic     initrd.img-2.6.32-24-generic  System.map-2.6.32-30-generic  vmlinuz-2.6.32-26-generic
    boot                      initrd.img-2.6.32-25-generic  vmcoreinfo-2.6.31-11-rt       vmlinuz-2.6.32-27-generic
    config-2.6.31-11-rt       initrd.img-2.6.32-26-generic  vmcoreinfo-2.6.32-21-generic  vmlinuz-2.6.32-28-generic
    config-2.6.32-21-generic  initrd.img-2.6.32-27-generic  vmcoreinfo-2.6.32-23-generic  vmlinuz-2.6.32-30-generic
    config-2.6.32-23-generic  initrd.img-2.6.32-28-generic  vmcoreinfo-2.6.32-24-generic
    config-2.6.32-24-generic  lost+found                    vmcoreinfo-2.6.32-25-generic
    config-2.6.32-25-generic  memtest86+.bin
    can I safely delete any of those ?
    I think in Synaptic you should try searching "linux-image-2"


    Run the following command in terminal
    Code:
    uname -r
    This will show the current kernel you are running. I would recommend removing the older ones but still leave the next most recent one just for safety.


    ~Caboose
    "When our actions do not, our fears do make us traitors." -- Shakespeare
    "Unless someone like you cares a whole awful lot, nothing is going to get better. It's not!" -- Dr. Seuss
    "No man has ever seen his dreams fulfilled and regretted the sacrifice necessary to fulfill them" -- Mattie Montgomery


  7. #7
    Join Date
    May 2007
    Beans
    65
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Cleaning up Kernel installations

    Thanks
    Finally some 111mb of free space on my 200MB /boot partition...

    But is there any way I can choose to automatically upgrade to the latest kernel and discard older ones when an upgrade happens ?
    I was used to this kind of an upgrading process back in my Arch Linux desktop....
    Last edited by MetalheadGautham; April 15th, 2011 at 06:30 AM.
    This signature does not exist

  8. #8
    Join Date
    Aug 2009
    Location
    Charleston, SC (USA)
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Cleaning up Kernel installations

    After some Googling it seems that Ubuntu does not support that...(I'm not going to say it can't because someone may add that feature later.)

    I would recommend updating to a higher version of Ubuntu (11.04 comes out in 13 days or 10.04 if you like LTS.) The newer versions will be able to run Ubuntu Tweak which makes it a few clicks to remove old kernels.

    Ubuntu Tweak doesn't do it automatically but its easier than Synaptic. You just sparked my curiosity to see if I can write a script that will auto remove kernels...

    ~Caboose
    "When our actions do not, our fears do make us traitors." -- Shakespeare
    "Unless someone like you cares a whole awful lot, nothing is going to get better. It's not!" -- Dr. Seuss
    "No man has ever seen his dreams fulfilled and regretted the sacrifice necessary to fulfill them" -- Mattie Montgomery


  9. #9
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Cleaning up Kernel installations

    As long as we are in other OS talk, other distros do a better job of managing old kernels without having to install additional packages or manually removing them.

    Fedora keeps 2 old kernels which is sufficient for most any circumstance.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  10. #10
    Join Date
    Jun 2007
    Location
    Southeast US
    Beans
    100
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Cleaning up Kernel installations

    Just another tack and a caveat. The caveat is, if you are using aptosid (was sidux), you should log out of GUI, log in as root, and go init 3 before messing around with apt-get.

    Say I have three kernels and want to get rid of the oldest one. So I get a list of what I have:
    Code:
    # ls -1 /boot/initrd*
    /boot/initrd.img-2.6.38-2.slh.6-aptosid-686
    /boot/initrd.img-2.6.38-2.slh.7-aptosid-686
    /boot/initrd.img-2.6.38-3.slh.2-aptosid-686
    Then I use dpkg to get the proper name for later use in apt-get:
    Code:
    # dpkg --get-selections | grep 2.6.38-2.slh.6-aptosid-686
    broadcom-sta-modules-2.6.38-2.slh.6-aptosid-686 install
    linux-headers-2.6.38-2.slh.6-aptosid-686 install
    linux-image-2.6.38-2.slh.6-aptosid-686 install
    You may notice an entry for my PCMCIA module. You may not see anything like this. I will not discuss that here (at least initially ).

    Next, run apt-get to take out the trash, so to speak:
    Code:
    # apt-get remove --purge \
    linux-headers-2.6.38-2.slh.6-aptosid-686 \
    linux-image-2.6.38-2.slh.6-aptosid-686
    Grub should be automagically updated by apt-get and you should no longer see the old stuff (because it shouldn't be there to see).
    --
    System76 Gazelle Professional (gazp6)

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
  •