Clean up old kernels in ubuntu - Ubuntu

This is a discussion on Clean up old kernels in ubuntu - Ubuntu ; On Tue, 17 Jun 2008 13:48:57 -0500, Ignoramus17809 wrote: > On 2008-06-17, Meat Plow wrote: >> On Tue, 17 Jun 2008 13:15:02 -0500, Ignoramus17809 wrote: >> >>> Old kernels seem to be accumulating instead of being phased out. So >>> ...

+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 21 to 40 of 83

Thread: Clean up old kernels in ubuntu

  1. Re: Clean up old kernels in ubuntu

    On Tue, 17 Jun 2008 13:48:57 -0500, Ignoramus17809 wrote:

    > On 2008-06-17, Meat Plow wrote:
    >> On Tue, 17 Jun 2008 13:15:02 -0500, Ignoramus17809 wrote:
    >>
    >>> Old kernels seem to be accumulating instead of being phased out. So
    >>> right now on my laptop I have
    >>>
    >>> i linux-image-2.6.24-12-generic - Linux kernel image for version
    >>> 2.6.24 on x i linux-image-2.6.24-15-generic - Linux kernel image
    >>> for version 2.6.24 on x i linux-image-2.6.24-16-generic - Linux
    >>> kernel image for version 2.6.24 on x i linux-image-2.6.24-17-generic
    >>> - Linux kernel image for version 2.6.24 on x i A
    >>> linux-image-2.6.24-18-generic - Linux kernel image for version
    >>> 2.6.24 on x i A linux-image-2.6.24-19-generic - Linux kernel image
    >>> for version 2.6.24 on x
    >>>
    >>>
    >>> which is way too much. Is there some way to clean them up so that I
    >>> have only a couple of latest ones (and maybe the first one).

    >>
    >> Delete them and remove the listing from /boot/grub/menu.lst? If you
    >> don't need to free up space just remove the entries from menu.lst.
    >>
    >>
    >>

    > I was hoping that there is either a setting, or a tool, to do it
    > automatically and safely.
    >
    > I want to both free up space as well as remove them from menu.lst.


    There is now an easy way with a GUI to take not show them on the menu.
    System/administration/start up-manager. If you don't have start up-
    manager, it can be downloaded from Synaptic.

  2. Re: Clean up old kernels in ubuntu

    On 2008-06-17, arnold wrote:
    > On Tue, 17 Jun 2008 13:48:57 -0500, Ignoramus17809 wrote:
    >
    >> On 2008-06-17, Meat Plow wrote:
    >>> On Tue, 17 Jun 2008 13:15:02 -0500, Ignoramus17809 wrote:
    >>>
    >>>> Old kernels seem to be accumulating instead of being phased out. So
    >>>> right now on my laptop I have
    >>>>
    >>>> i linux-image-2.6.24-12-generic - Linux kernel image for version
    >>>> 2.6.24 on x i linux-image-2.6.24-15-generic - Linux kernel image
    >>>> for version 2.6.24 on x i linux-image-2.6.24-16-generic - Linux
    >>>> kernel image for version 2.6.24 on x i linux-image-2.6.24-17-generic
    >>>> - Linux kernel image for version 2.6.24 on x i A
    >>>> linux-image-2.6.24-18-generic - Linux kernel image for version
    >>>> 2.6.24 on x i A linux-image-2.6.24-19-generic - Linux kernel image
    >>>> for version 2.6.24 on x
    >>>>
    >>>>
    >>>> which is way too much. Is there some way to clean them up so that I
    >>>> have only a couple of latest ones (and maybe the first one).
    >>>
    >>> Delete them and remove the listing from /boot/grub/menu.lst? If you
    >>> don't need to free up space just remove the entries from menu.lst.
    >>>
    >>>
    >>>

    >> I was hoping that there is either a setting, or a tool, to do it
    >> automatically and safely.
    >>
    >> I want to both free up space as well as remove them from menu.lst.

    >
    > There is now an easy way with a GUI to take not show them on the menu.
    > System/administration/start up-manager. If you don't have start up-
    > manager, it can be downloaded from Synaptic.


    Is there something automatic, though? Something I can just do at night
    from scripts? The only versions that I care about keeping, are the
    current version that is running, and the latest.

    I suppose that I could just write a perl script.

    --
    Due to extreme spam originating from Google Groups, and their inattention
    to spammers, I and many others block all articles originating
    from Google Groups. If you want your postings to be seen by
    more readers you will need to find a different means of
    posting on Usenet.
    http://improve-usenet.org/

  3. Re: Clean up old kernels in ubuntu

    Moog wrote:
    > No problem. It beats the hell out of b0rking the klack out of your menu.list
    > using nano from within single user mode. ;-)


    Nano? Weak!


    --
    As we enjoy great advantages from inventions of others, we should be
    glad of an opportunity to serve others by any invention of ours;
    and this we should do freely and generously.
    --Benjamin Franklin

  4. Re: Clean up old kernels in ubuntu

    johnny bobby bee illuminated alt.os.linux.ubuntu by typing:
    > Moog wrote:
    >> No problem. It beats the hell out of b0rking the klack out of your menu.list
    >> using nano from within single user mode. ;-)

    >
    > Nano? Weak!
    >


    I do use vim, but is it installed by default?

    I mentioned Nano for the benefit of the n00bs. ;-)

    --
    Moog

    “Are you going to come quietly, or do I have to use earplugs?”

  5. Re: Clean up old kernels in ubuntu

    Ignoramus17809 illuminated alt.os.linux.ubuntu by typing:

    >
    > Is there something automatic, though? Something I can just do at night
    > from scripts? The only versions that I care about keeping, are the
    > current version that is running, and the latest.


    It's literally a 20 second job and only needs to be done once a new
    kernel is available.

    > I suppose that I could just write a perl script.


    Blimey. You'd go that far? Writing one would probably take you longer
    to do than performing the simple task, occasionally, over the lifecycle
    of the distro.

    --
    Moog

    “Are you going to come quietly, or do I have to use earplugs?”

  6. Re: Clean up old kernels in ubuntu

    Trevor Best illuminated alt.os.linux.ubuntu by typing:
    > On Tue, 17 Jun 2008 19:36:30 +0000, Moog wrote:
    >
    >> The tools are there to do what you require. Simply use them. You can
    >> make a decision to remove all of themif you want. I would, as
    >> previously suggested, keep at *least* two.

    >
    > I got all mine, just commented out the older ones in menu.lst to keep the
    > boot screen sane. I think I need to collect a quite a few more old kernels
    > before disk space becomes an issue :-)


    A true linux squirrel. ;-)

    --
    Moog

    “Are you going to come quietly, or do I have to use earplugs?”

  7. Re: Clean up old kernels in ubuntu

    On 2008-06-17, Moog wrote:
    > Ignoramus17809 illuminated alt.os.linux.ubuntu by typing:
    >
    >>
    >> Is there something automatic, though? Something I can just do at night
    >> from scripts? The only versions that I care about keeping, are the
    >> current version that is running, and the latest.

    >
    > It's literally a 20 second job and only needs to be done once a new
    > kernel is available.
    >


    I have 12 computers to take care of.

    >
    > Blimey. You'd go that far? Writing one would probably take you longer
    > to do than performing the simple task, occasionally, over the lifecycle
    > of the distro.
    >


    I do not think like that.

    I think that automation is the main benefit of Linux and should be
    used. I suspect strongly that a tool or setting to do what I want,
    already exists and we are simply not aware of it.

    I am almost done writing my script to do that.

    --
    Due to extreme spam originating from Google Groups, and their inattention
    to spammers, I and many others block all articles originating
    from Google Groups. If you want your postings to be seen by
    more readers you will need to find a different means of
    posting on Usenet.
    http://improve-usenet.org/

  8. Re: Clean up old kernels in ubuntu


    "Ignoramus17809" wrote in
    message news:nYOdnetRdMW7YsrVnZ2dnUVZ_qvinZ2d@giganews.com ...
    > Old kernels seem to be accumulating instead of being phased out. So
    > right now on my laptop I have
    >
    > i linux-image-2.6.24-12-generic - Linux kernel image for version
    > 2.6.24 on x
    > i linux-image-2.6.24-15-generic - Linux kernel image for version
    > 2.6.24 on x
    > i linux-image-2.6.24-16-generic - Linux kernel image for version
    > 2.6.24 on x
    > i linux-image-2.6.24-17-generic - Linux kernel image for version
    > 2.6.24 on x
    > i A linux-image-2.6.24-18-generic - Linux kernel image for version
    > 2.6.24 on x
    > i A linux-image-2.6.24-19-generic - Linux kernel image for version
    > 2.6.24 on x
    >
    >


    In Hardy the simpliest way to do it through Synaptic. I've just
    cleaned up my install.

    Go to Synaptic and search for linux-image-2. Mark all of them but the
    latest (if this is what you want, you may chose to leave the last one
    or two, as you wish) for complete removal. Then hit Apply.

    Synaptic will remove them and will update your grub menu.lst
    automatically, no need to interfere.

    The above will still leaves old linux headers intact. So, if you want
    to get rid of them as well, search for linux-headers in Synaptic and
    remove them as above.

    Very clean and with minimal effort. The advises using aptitude or
    apt-get update and then to edit menu.lst are valid but they come from
    the previous Ubuntu experience (my understanding, do not kill me here
    :->), since previous editions did not bother to update grub menu.lst.

    Hardy instead behaves as a good boy. So, why bother editing menu.lst
    manually?



  9. Re: Clean up old kernels in ubuntu

    On Tue, 17 Jun 2008 22:18:51 +0000, Moog wrote:

    >>> No problem. It beats the hell out of b0rking the klack out of your
    >>> menu.list using nano from within single user mode. ;-)


    >> Nano? Weak!


    > I do use vim, but is it installed by default? I mentioned Nano for the
    > benefit of the n00bs. ;-)


    You're the n00b, if you think editing menu.lst with nano (or with vi) is
    something hard or scary.

    Ooooohhhh! Using a text editor??? Oh my! That's too complicated!

    LOL. n00b.


    --
    "Bother!" said Pooh, as the dirigible popped.


  10. Re: Clean up old kernels in ubuntu

    Ignoramus17809 wrote:
    > On 2008-06-17, Andreas Wagner wrote:
    >> Ignoramus17809 schrieb:
    >>
    >>> Old kernels seem to be accumulating instead of being phased out. So
    >>> right now on my laptop I have
    >>>
    >>> i linux-image-2.6.24-12-generic - Linux kernel image for version
    >>> 2.6.24 on x
    >>> i linux-image-2.6.24-15-generic - Linux kernel image for version
    >>> 2.6.24 on x
    >>> i linux-image-2.6.24-16-generic - Linux kernel image for version
    >>> 2.6.24 on x
    >>> i linux-image-2.6.24-17-generic - Linux kernel image for version
    >>> 2.6.24 on x
    >>> i A linux-image-2.6.24-18-generic - Linux kernel image for version
    >>> 2.6.24 on x
    >>> i A linux-image-2.6.24-19-generic - Linux kernel image for version
    >>> 2.6.24 on x
    >>>
    >>>
    >>> which is way too much. Is there some way to clean them up so that I
    >>> have only a couple of latest ones (and maybe the first one).

    >> Hi there!
    >>
    >> The command
    >> sudo aptitude remove linux-image-2.6.24-12-generic
    >>
    >> will remove the package "linux-image-2.6.24-12-generic", for example.
    >> You can do that for each kernel-package or for sereral at once by just
    >> appending them to the commandline given above. See the man-page and
    >> aptitude --help for more details.
    >>
    >> *Ensure*, that you have at least one working kernel-image installed.
    >> It's always a good idea to have a rescue-cd in range, for the case that
    >> something goes very wrong!
    >>

    >
    > Yes, but... I want to do it automatically, when a new kernel is
    > installed, all old ones up to the current ones should get deleted.
    >
    > I believe that Fedora does this.
    >


    You could set up something like a cron job that would (by some
    combination of ls -a, wc, sed, perl, and tail) find all old vmlinuz*
    files in /boot and remove the associated packages using apt or so, as
    suggested by Andreas.

    Instead of a cron job, you could run it at boot time, since you will be
    rebooting after updating to your new kernel. That way you could assume
    the invariant that there would be at most one old kernel. Then you
    could just remove the package for the older of the two vmlinuz* files,
    if there were more than one at boot time.

  11. Re: Clean up old kernels in ubuntu

    Dan C illuminated alt.os.linux.ubuntu by typing:
    > On Tue, 17 Jun 2008 22:18:51 +0000, Moog wrote:
    >
    >>>> No problem. It beats the hell out of b0rking the klack out of your
    >>>> menu.list using nano from within single user mode. ;-)

    >
    >>> Nano? Weak!

    >
    >> I do use vim, but is it installed by default? I mentioned Nano for the
    >> benefit of the n00bs. ;-)

    >
    > You're the n00b, if you think editing menu.lst with nano (or with vi) is
    > something hard or scary.
    >
    > Ooooohhhh! Using a text editor??? Oh my! That's too complicated!
    >
    > LOL. n00b.


    Heh. Hi Dan.

    Honestly. You seem to have lost your eyesight. The winky smiley things
    are intended as a guide.

    Still. I wouldn't have expected anything else from you.

    Well. Actually, a "bugger off" or a "win-droid" would have been nice.
    You *have* go a reputation to uphold, dontcha know!

    --
    Moog

    “Are you going to come quietly, or do I have to use earplugs?”

  12. Re: Clean up old kernels in ubuntu

    Ignoramus17809 illuminated alt.os.linux.ubuntu by typing:
    > On 2008-06-17, Moog wrote:
    >> Ignoramus17809 illuminated alt.os.linux.ubuntu by typing:
    >>
    >>>
    >>> Is there something automatic, though? Something I can just do at night
    >>> from scripts? The only versions that I care about keeping, are the
    >>> current version that is running, and the latest.

    >>
    >> It's literally a 20 second job and only needs to be done once a new
    >> kernel is available.
    >>

    >
    > I have 12 computers to take care of.


    Understood.

    --
    Moog

    “Are you going to come quietly, or do I have to use earplugs?”

  13. Re: Clean up old kernels in ubuntu

    On 2008-06-18, Moog wrote:
    > Dan C illuminated alt.os.linux.ubuntu by typing:
    >> On Tue, 17 Jun 2008 22:18:51 +0000, Moog wrote:
    >>
    >>>>> No problem. It beats the hell out of b0rking the klack out of your
    >>>>> menu.list using nano from within single user mode. ;-)

    >>
    >>>> Nano? Weak!

    >>
    >>> I do use vim, but is it installed by default? I mentioned Nano for the
    >>> benefit of the n00bs. ;-)

    >>
    >> You're the n00b, if you think editing menu.lst with nano (or with vi) is
    >> something hard or scary.
    >>
    >> Ooooohhhh! Using a text editor??? Oh my! That's too complicated!
    >>
    >> LOL. n00b.

    >
    > Heh. Hi Dan.
    >
    > Honestly. You seem to have lost your eyesight. The winky smiley things
    > are intended as a guide.
    >
    > Still. I wouldn't have expected anything else from you.
    >
    > Well. Actually, a "bugger off" or a "win-droid" would have been nice.
    > You *have* go a reputation to uphold, dontcha know!
    >


    [Damn - I've killfiled Dan C, but I keep seeing his messages anyway
    because people keep replying to him. Maybe I should just killfile
    everybody ;-) ]


    --


  14. Re: Clean up old kernels in ubuntu

    Moog wrote:
    > I do use vim, but is it installed by default?


    Well, vi is included by default.

    --
    As we enjoy great advantages from inventions of others, we should be
    glad of an opportunity to serve others by any invention of ours;
    and this we should do freely and generously.
    --Benjamin Franklin

  15. Re: Clean up old kernels in ubuntu



    "Moog" wrote in message
    news:6bqribF3d7m06U1@mid.individual.net...
    > johnny bobby bee illuminated alt.os.linux.ubuntu by typing:
    >> Moog wrote:
    >>> No problem. It beats the hell out of b0rking the klack out of your
    >>> menu.list
    >>> using nano from within single user mode. ;-)

    >>
    >> Nano? Weak!
    >>

    >
    > I do use vim, but is it installed by default?
    >
    > I mentioned Nano for the benefit of the n00bs. ;-)


    I've had to use nano to get Ubuntu to install before now. ;-)





  16. Re: Clean up old kernels in ubuntu

    Vitorio Okio wrote:

    >
    > Very clean and with minimal effort. The advises using aptitude or
    > apt-get update and then to edit menu.lst are valid but they come from
    > the previous Ubuntu experience (my understanding, do not kill me here
    > :->), since previous editions did not bother to update grub menu.lst.


    I just inspected my menu.lst and saw that there were no entries for the
    older kernels, I recently removed via aptitude. Since I didn't touch
    the file myself, aptitude must have removed their entries from the
    file. (And I'm the only one using this computer.)

    By the way: aptitude also automatically cared about the header-files,
    which were orphaned after uninstalling the kernel-image and removed
    them too.

    Greetings
    Andreas

  17. Re: Clean up old kernels in ubuntu

    On Wed, 18 Jun 2008 14:47:30 +0200, Andreas Wagner wrote:


    > By the way: aptitude also automatically cared about the header-files,
    > which were orphaned after uninstalling the kernel-image and removed them
    > too.


    Are these "header files" related to recompiling the kernel or....?

    Also where would they be located? I'm interested to see if Boot Manager
    also removed the old ones. Thanks! :-)



  18. Re: Clean up old kernels in ubuntu

    Matt wrote:

    > You could set up something like a cron job that would (by some
    > combination of ls -a, wc, sed, perl, and tail) find all old vmlinuz*
    > files in /boot and remove the associated packages using apt or so, as
    > suggested by Andreas.
    >
    > Instead of a cron job, you could run it at boot time, since you will
    > be rebooting after updating to your new kernel. That way you could
    > assume the invariant that there would be at most one old kernel. Then
    > you could just remove the package for the older of the two vmlinuz*
    > files, if there were more than one at boot time.



    A roofer could use a ten-pound sledge hammer to make sure all the nails
    were fully driven.

    Just how difficult is it to remove a kernel once every 90 days?


    --
    John

    No Microsoft, Apple, Intel, Novell, Trend Micro, nor Ford products were used in the preparation or transmission of this message.

    The EULA sounds like it was written by a team of lawyers who want to tell me what I can't do. The GPL sounds like it was written by a human being, who wants me to know what I can do.

  19. Re: Clean up old kernels in ubuntu

    On Tue, 17 Jun 2008 19:27:18 +0000, Peter J Ross wrote:

    > In alt.os.linux.debian on Tue, 17 Jun 2008 15:07:13 -0400, Meat Plow
    > wrote:
    >
    >> The menu list is easy and safe to edit, just make a backup copy. Read
    >> the list in Kate or your favorite gui editor and it will tell you how to
    >> edit it.

    >
    > This will, however, need to be done as root. And the menu list will
    > reappear whenever "update-grub" is run automatically, for example when a
    > new kernel upgrade is available. Removing the packages with apt / aptitude
    > / synaptic / adept is probably best.


    Nah hand removing is the easiest. And it's a given if the user knows
    anything about linux that the file cannot be saved unless you are root or
    su.

    >
    >> The initrd and vmlinuz modules are all marked with the same build
    >> numbers. However they do not occupy much space at all maybe 50 megs for
    >> 4 successive build updates. If you're scrimping for 50 megs you should
    >> upgrade your storage.

    >
    > Some people use a small partition for /boot. In any case, keeping obsolete
    > kernels, which have perhaps been updated because of security holes, may
    > not be a good idea.


    Not an issue if the kernel isn't being used. However I guess I might be
    giving too broad of a credit in the savvy department and I probably should
    realize that some n00bs actually read this group.

    --
    #1 Offishul Ruiner of Usenet, March 2007
    #1 Usenet Asshole, March 2007
    #10 Most hated Usenetizen of all time
    Pierre Salinger Memorial Hook, Line & Sinker, June 2004
    Pierre Salinger Memorial Hook, Line & Sinker, May 2008
    COOSN-266-06-25794



  20. Re: Clean up old kernels in ubuntu

    On Wed, 18 Jun 2008 12:15:10 -0400, Meat Plow wrote:

    > However I guess I might be
    > giving too broad of a credit in the savvy department and I probably
    > should realize that some n00bs actually read this group.


    There are newbies who write in this group too....

+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast