<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The kernel collection</title>
	<atom:link href="http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/</link>
	<description>Admin Spotting for Fun and Profit</description>
	<lastBuildDate>Fri, 16 Jul 2010 09:41:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Claire Connelly</title>
		<link>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/comment-page-1/#comment-60</link>
		<dc:creator>Claire Connelly</dc:creator>
		<pubDate>Sat, 24 May 2008 18:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=29#comment-60</guid>
		<description>I wrote the following script to clean up extra kernels.  It will leave you with the newest kernel and the kernel you&#039;re currently running if they aren&#039;t the same.


#!/usr/bin/perl -w

### zap-kernels - remove old kernels from system
###
### C.M. Connelly 
###
### Tue Jul 22 15:43:24 PDT 2003


use strict;


my $current_kernel = `uname -r`;
$current_kernel =~ s/smp$//;

my @packages = grep { m/^kernel/ } ( `rpm -qa` );
my @kernels;

foreach my $kind ( &quot;&quot;, &quot;-smp&quot; ) {
  my $numberadded = 0;
  foreach my $package ( sort @packages ) {
    if ( $package =~ m/^kernel$kind-2/ ) {
      unless ( $package =~ m/$current_kernel/ ) {
        chomp $package;
        push @kernels, $package;
        ++$numberadded;
      }
    }
  }
  if ( $numberadded != 0 ) {
    my $newest_kernel = pop @kernels;
#    print &quot;Removing $newest_kernel from the list of $numberadded bad kernels.\n&quot;;
  }
}

#print &quot;Bad kernels!\n@kernels\n&quot;;

`rpm -e --allmatches @kernels`;
</description>
		<content:encoded><![CDATA[<p>I wrote the following script to clean up extra kernels.  It will leave you with the newest kernel and the kernel you&#8217;re currently running if they aren&#8217;t the same.</p>
<p>#!/usr/bin/perl -w</p>
<p>### zap-kernels &#8211; remove old kernels from system<br />
###<br />
### C.M. Connelly<br />
###<br />
### Tue Jul 22 15:43:24 PDT 2003</p>
<p>use strict;</p>
<p>my $current_kernel = `uname -r`;<br />
$current_kernel =~ s/smp$//;</p>
<p>my @packages = grep { m/^kernel/ } ( `rpm -qa` );<br />
my @kernels;</p>
<p>foreach my $kind ( &#8220;&#8221;, &#8220;-smp&#8221; ) {<br />
  my $numberadded = 0;<br />
  foreach my $package ( sort @packages ) {<br />
    if ( $package =~ m/^kernel$kind-2/ ) {<br />
      unless ( $package =~ m/$current_kernel/ ) {<br />
        chomp $package;<br />
        push @kernels, $package;<br />
        ++$numberadded;<br />
      }<br />
    }<br />
  }<br />
  if ( $numberadded != 0 ) {<br />
    my $newest_kernel = pop @kernels;<br />
#    print &#8220;Removing $newest_kernel from the list of $numberadded bad kernels.\n&#8221;;<br />
  }<br />
}</p>
<p>#print &#8220;Bad kernels!\n@kernels\n&#8221;;</p>
<p>`rpm -e &#8211;allmatches @kernels`;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Perrin</title>
		<link>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/comment-page-1/#comment-58</link>
		<dc:creator>Jim Perrin</dc:creator>
		<pubDate>Thu, 22 May 2008 20:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=29#comment-58</guid>
		<description>For newer centos/RHEL installs, yes and that&#039;s a very good point. I&#039;d forgotten about the yum-utils bits.

For CentOS 3, yum is too old to support yum-utils enhancements though.</description>
		<content:encoded><![CDATA[<p>For newer centos/RHEL installs, yes and that&#8217;s a very good point. I&#8217;d forgotten about the yum-utils bits.</p>
<p>For CentOS 3, yum is too old to support yum-utils enhancements though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bart Schaefer</title>
		<link>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/comment-page-1/#comment-57</link>
		<dc:creator>Bart Schaefer</dc:creator>
		<pubDate>Thu, 22 May 2008 14:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=29#comment-57</guid>
		<description>There&#039;s also &quot;package-cleanup --oldkernels&quot; from the yum-utils package.</description>
		<content:encoded><![CDATA[<p>There&#8217;s also &#8220;package-cleanup &#8211;oldkernels&#8221; from the yum-utils package.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Hrbáč</title>
		<link>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/comment-page-1/#comment-56</link>
		<dc:creator>David Hrbáč</dc:creator>
		<pubDate>Thu, 22 May 2008 13:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=29#comment-56</guid>
		<description>Simple way:
if [ $(rpm -q kernel &#124; wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel &#124; sed &#039;$d&#039;); fi
if [ $(rpm -q kernel-smp &#124; wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel-smp &#124; sed &#039;$d&#039;); fi</description>
		<content:encoded><![CDATA[<p>Simple way:<br />
if [ $(rpm -q kernel | wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel | sed &#8216;$d&#8217;); fi<br />
if [ $(rpm -q kernel-smp | wc -l) -gt 1 ]; then rpm -e $(rpm -q kernel-smp | sed &#8216;$d&#8217;); fi</p>
]]></content:encoded>
	</item>
</channel>
</rss>
