<?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: How to Delete Old Unused Kernels in CentOS, RHEL and Fedora	</title>
	<atom:link href="https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Tue, 04 Feb 2025 16:03:32 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Simon C		</title>
		<link>https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-2267984</link>

		<dc:creator><![CDATA[Simon C]]></dc:creator>
		<pubDate>Tue, 04 Feb 2025 16:03:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=26995#comment-2267984</guid>

					<description><![CDATA[The &lt;code&gt;dnf&lt;/code&gt; command is incorrect, at least on &lt;strong&gt;RHEL 9&lt;/strong&gt;. When I used your syntax, it returned lines including the current kernel. I had to change &lt;code&gt;`-2`&lt;/code&gt; to return the correct details.]]></description>
			<content:encoded><![CDATA[<p>The <code>dnf</code> command is incorrect, at least on <strong>RHEL 9</strong>. When I used your syntax, it returned lines including the current kernel. I had to change <code>`-2`</code> to return the correct details.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Johnny Kitchens		</title>
		<link>https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-1367544</link>

		<dc:creator><![CDATA[Johnny Kitchens]]></dc:creator>
		<pubDate>Sun, 27 Sep 2020 03:03:32 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=26995#comment-1367544</guid>

					<description><![CDATA[How to remove from boot menu old 5.8.7 and 5.8.9]]></description>
			<content:encoded><![CDATA[<p>How to remove from boot menu old 5.8.7 and 5.8.9</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jo		</title>
		<link>https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-1318286</link>

		<dc:creator><![CDATA[jo]]></dc:creator>
		<pubDate>Sat, 22 Feb 2020 22:51:55 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=26995#comment-1318286</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-911921&quot;&gt;Aaron Kili&lt;/a&gt;.

but actually the only command working correctly is the one Michael provided.
&lt;pre&gt;
# dnf remove $(rpm -qa &#124; awk &#039;/^kernel/&#039; &#124; grep -v $(uname -r))
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-911921">Aaron Kili</a>.</p>
<p>but actually the only command working correctly is the one Michael provided.</p>
<pre>
# dnf remove $(rpm -qa | awk '/^kernel/' | grep -v $(uname -r))
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: disp		</title>
		<link>https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-1128979</link>

		<dc:creator><![CDATA[disp]]></dc:creator>
		<pubDate>Wed, 10 Apr 2019 15:47:30 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=26995#comment-1128979</guid>

					<description><![CDATA[Configuration file for dnf: &lt;code&gt;/etc/dnf/dnf.conf&lt;/code&gt;.]]></description>
			<content:encoded><![CDATA[<p>Configuration file for dnf: <code>/etc/dnf/dnf.conf</code>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: noone		</title>
		<link>https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-958236</link>

		<dc:creator><![CDATA[noone]]></dc:creator>
		<pubDate>Sat, 06 Jan 2018 07:17:07 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=26995#comment-958236</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-958231&quot;&gt;noone&lt;/a&gt;.

Actually, 
&lt;pre&gt;
# dnf repoquery --installonly --latest-limit=-1 -q
&lt;/pre&gt;
Does list the older kernel. It looks like &lt;strong&gt;=[nospace]-X&lt;/strong&gt; is required for this to work in F27 at least, the wiki has no = and a space. Positive numbers go from new to old and negative numbers start at the oldest.

My method above is longer but would allow you to pick random kernels for the keep list,
&lt;pre&gt;
[root@hp1 ~]# dnf repoquery --installonly --latest-limit=-1 -q
kernel-0:4.14.8-300.fc27.x86_64
kernel-core-0:4.14.8-300.fc27.x86_64
kernel-devel-0:4.14.8-300.fc27.x86_64
kernel-modules-0:4.14.8-300.fc27.x86_64
kernel-modules-extra-0:4.14.8-300.fc27.x86_64
&lt;pre&gt;
&lt;pre&gt;
[root@hp1 ~]# dnf repoquery --installonly --latest-limit 2 -q
kernel-0:4.14.11-300.fc27.x86_64
kernel-0:4.14.8-300.fc27.x86_64
kernel-core-0:4.14.11-300.fc27.x86_64
kernel-core-0:4.14.8-300.fc27.x86_64
kernel-devel-0:4.14.11-300.fc27.x86_64
kernel-devel-0:4.14.8-300.fc27.x86_64
kernel-modules-0:4.14.11-300.fc27.x86_64
kernel-modules-0:4.14.8-300.fc27.x86_64
kernel-modules-extra-0:4.14.11-300.fc27.x86_64
kernel-modules-extra-0:4.14.8-300.fc27.x86_64
&lt;/pre&gt;
usage: dnf repoquery...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/delete-old-kernels-in-centos-rhel-and-fedora/comment-page-1/#comment-958231">noone</a>.</p>
<p>Actually, </p>
<pre>
# dnf repoquery --installonly --latest-limit=-1 -q
</pre>
<p>Does list the older kernel. It looks like <strong>=[nospace]-X</strong> is required for this to work in F27 at least, the wiki has no = and a space. Positive numbers go from new to old and negative numbers start at the oldest.</p>
<p>My method above is longer but would allow you to pick random kernels for the keep list,</p>
<pre>
[root@hp1 ~]# dnf repoquery --installonly --latest-limit=-1 -q
kernel-0:4.14.8-300.fc27.x86_64
kernel-core-0:4.14.8-300.fc27.x86_64
kernel-devel-0:4.14.8-300.fc27.x86_64
kernel-modules-0:4.14.8-300.fc27.x86_64
kernel-modules-extra-0:4.14.8-300.fc27.x86_64
</pre>
<pre>
</pre>
<pre>
[root@hp1 ~]# dnf repoquery --installonly --latest-limit 2 -q
kernel-0:4.14.11-300.fc27.x86_64
kernel-0:4.14.8-300.fc27.x86_64
kernel-core-0:4.14.11-300.fc27.x86_64
kernel-core-0:4.14.8-300.fc27.x86_64
kernel-devel-0:4.14.11-300.fc27.x86_64
kernel-devel-0:4.14.8-300.fc27.x86_64
kernel-modules-0:4.14.11-300.fc27.x86_64
kernel-modules-0:4.14.8-300.fc27.x86_64
kernel-modules-extra-0:4.14.11-300.fc27.x86_64
kernel-modules-extra-0:4.14.8-300.fc27.x86_64
</pre>
<p>usage: dnf repoquery...</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
