Distro-provided mechanism to clean up old kernels

Craig White craig.white at ttiltd.com
Thu Feb 16 21:08:25 UTC 2012


this was interesting but I found that I had to NOT use 'head -n -2' but rather 'head -n 2'

Craig

On Feb 16, 2012, at 1:31 PM, Kees Cook wrote:

> On Thu, Feb 16, 2012 at 02:21:18PM -0500, Barry Warsaw wrote:
>> On Feb 16, 2012, at 10:11 AM, Dustin Kirkland wrote:
>>> I asked about this in IRC yesterday, and Colin Watson pointed me to
>>> the computer-janitor utility, which is intended to handle this.
>>> Seconds later, Barry Warsaw told me that computer-janitor should die
>>> :-)
>> 
>> c-j needs attention, but I'm not particularly motivated to give it what it
>> needs.  There's basic housekeeping, such as that the code for c-j is sprinkled
>> between the update-manager and the computer-janitor packages, and even more
>> important problems such LP: #458872.  What's demotivating though is that in
>> all the discussions we've had about the tool, most people think it's just not
>> user-friendly enough given today's emphasis on software-center.
> 
> FWIW, this is the highly advanced system I use for my auto-updated VMs. It
> keeps the latest 2 kernels:
> 
> OLD=$(ls -tr /boot/vmlinuz-* | head -n -2 | cut -d- -f2- | \
> 	awk '{print "linux-image-" $0}')
> if [ -n "$OLD" ]; then
>    apt-get -qy remove --purge $OLD
> fi
> 
> Be warned, of course, that if you don't reboot often, you can end up
> removing the kernel you're running. :P
> 
> -Kees
> 
> -- 
> Kees Cook
> 
> -- 
> ubuntu-server mailing list
> ubuntu-server at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
> More info: https://wiki.ubuntu.com/ServerTeam

-- 
Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ craig.white at ttiltd.com
1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com 

Need help communicating between generations at work to achieve your desired success? Let us help!





More information about the ubuntu-server mailing list