<?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: Quickzi: How To Remove Older Kernels from Ubuntu</title>
	<atom:link href="http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/</link>
	<description>Linux Tips, Tricks, and Opinions</description>
	<lastBuildDate>Wed, 27 Jun 2012 07:49:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
	<item>
		<title>By: squishy</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-102260</link>
		<dc:creator>squishy</dc:creator>
		<pubDate>Mon, 21 Mar 2011 17:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-102260</guid>
		<description>@Farky If you&#039;re running Synaptic Package Manager at the same time as trying to run a dpkg command, you&#039;ll get that.  This is because you may only run one instance of apt-get at a time, and as I understand it, Synaptic grabs the lock the whole time it&#039;s running.  All you need to do is quit Synaptic and try it again, it should be no problem.</description>
		<content:encoded><![CDATA[<p>@Farky If you&#8217;re running Synaptic Package Manager at the same time as trying to run a dpkg command, you&#8217;ll get that.  This is because you may only run one instance of apt-get at a time, and as I understand it, Synaptic grabs the lock the whole time it&#8217;s running.  All you need to do is quit Synaptic and try it again, it should be no problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-101232</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Thu, 17 Mar 2011 15:11:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-101232</guid>
		<description>Farky,

This usually means you are not running as root (sudo command) or you have apt-get running somewhere else.

To fix it for me, I changed the last portion of nthalk&#039;s to:

&#124; xargs sudo apt-get remove -y &amp;&amp; sudo update-initramfs -u</description>
		<content:encoded><![CDATA[<p>Farky,</p>
<p>This usually means you are not running as root (sudo command) or you have apt-get running somewhere else.</p>
<p>To fix it for me, I changed the last portion of nthalk&#8217;s to:</p>
<p>| xargs sudo apt-get remove -y &amp;&amp; sudo update-initramfs -u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Farky</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-95880</link>
		<dc:creator>Farky</dc:creator>
		<pubDate>Tue, 22 Feb 2011 03:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-95880</guid>
		<description>doesn&#039;t work, I get this error:

&quot;Could not get lock /var/lib/dpkg/lock&quot;

Wonder why Linux makes it so difficult to remove older versions?</description>
		<content:encoded><![CDATA[<p>doesn&#8217;t work, I get this error:</p>
<p>&#8220;Could not get lock /var/lib/dpkg/lock&#8221;</p>
<p>Wonder why Linux makes it so difficult to remove older versions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-90182</link>
		<dc:creator>Tommy</dc:creator>
		<pubDate>Thu, 27 Jan 2011 14:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-90182</guid>
		<description>The shell command nthalk supplied is excellent! I especially appreciate the description of what it&#039;s doing. UNFORTUNATELY this site&#039;s blog software replaced all the single quotes with the &quot;pretty&quot; ones, so you cannot cut and paste the command and expect it to work.

To play with it, copy everything up to before the last pipe &#124; character, open a terminal, paste it in (using either Edit --&gt; Paste or shift-control-P) then backspace and replace all the curly single quotes with the non-curly single quote (next to the Enter key on US keyboards). When you press Enter, you should see the list of outdated kernels. 

Then once you feel confident you can up-arrow to see the successful command again and type or paste the last bit 

&lt;code&gt;

&#124; xargs apt-get remove -y &amp;&amp; update-initramfs -u

&lt;/code&gt;

I don&#039;t know if this blog allows any tags like code but if folks are pasting in code it would be nice to have &quot;pretty&quot; quotes and whatever else turned off. Thanks to nthalk and Foogazi!</description>
		<content:encoded><![CDATA[<p>The shell command nthalk supplied is excellent! I especially appreciate the description of what it&#8217;s doing. UNFORTUNATELY this site&#8217;s blog software replaced all the single quotes with the &#8220;pretty&#8221; ones, so you cannot cut and paste the command and expect it to work.</p>
<p>To play with it, copy everything up to before the last pipe | character, open a terminal, paste it in (using either Edit &#8211;&gt; Paste or shift-control-P) then backspace and replace all the curly single quotes with the non-curly single quote (next to the Enter key on US keyboards). When you press Enter, you should see the list of outdated kernels. </p>
<p>Then once you feel confident you can up-arrow to see the successful command again and type or paste the last bit </p>
<p><code></p>
<p>| xargs apt-get remove -y &amp;&amp; update-initramfs -u</p>
<p></code></p>
<p>I don&#8217;t know if this blog allows any tags like code but if folks are pasting in code it would be nice to have &#8220;pretty&#8221; quotes and whatever else turned off. Thanks to nthalk and Foogazi!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allan</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-86784</link>
		<dc:creator>Allan</dc:creator>
		<pubDate>Fri, 14 Jan 2011 01:59:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-86784</guid>
		<description>What w-sky said USED to be right. However, autoremove no longer cleans out old kernels.</description>
		<content:encoded><![CDATA[<p>What w-sky said USED to be right. However, autoremove no longer cleans out old kernels.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goat</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-58359</link>
		<dc:creator>goat</dc:creator>
		<pubDate>Tue, 03 Aug 2010 20:41:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-58359</guid>
		<description>What w-sky said is absolutely wrong.</description>
		<content:encoded><![CDATA[<p>What w-sky said is absolutely wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nthalk</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-52775</link>
		<dc:creator>nthalk</dc:creator>
		<pubDate>Fri, 23 Apr 2010 17:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-52775</guid>
		<description>What w-sky is sorta wrong. I&#039;ve got several kernel versions that do not get removed by that, and I do not remember if that ever did anything useful for grub menu kernel cleanup. Additionally, the hunt and peck method by the blog author is prone to &quot;oops&quot; due to the attention to detail required

I use this command:

# dpkg -l &#124; grep ^ii &#124; grep linux-image &#124; grep -v image-generic &#124; grep -v `uname -r &#124; cut -d&#039;-&#039; -f1,2` &#124; cut -d&#039; &#039; -f3 &#124; xargs apt-get remove -y &amp;&amp; update-initramfs -u

It says: list the packages (&#124;), find the ones that are installed (&#124;) and named linux-image (&#124;), but not the image-generic (&#124;). Then take the one that we are currently using (`) out of the list (&#124;). Now remove every image left in that list (&#124;) and update my grub menu(&amp;&amp;).

You will not be left with a backup kernel, but I&#039;ve never had a problem that could not be solved with the recovery mode of the current kernel.</description>
		<content:encoded><![CDATA[<p>What w-sky is sorta wrong. I&#8217;ve got several kernel versions that do not get removed by that, and I do not remember if that ever did anything useful for grub menu kernel cleanup. Additionally, the hunt and peck method by the blog author is prone to &#8220;oops&#8221; due to the attention to detail required</p>
<p>I use this command:</p>
<p># dpkg -l | grep ^ii | grep linux-image | grep -v image-generic | grep -v `uname -r | cut -d&#8217;-&#8217; -f1,2` | cut -d&#8217; &#8216; -f3 | xargs apt-get remove -y &amp;&amp; update-initramfs -u</p>
<p>It says: list the packages (|), find the ones that are installed (|) and named linux-image (|), but not the image-generic (|). Then take the one that we are currently using (`) out of the list (|). Now remove every image left in that list (|) and update my grub menu(&amp;&amp;).</p>
<p>You will not be left with a backup kernel, but I&#8217;ve never had a problem that could not be solved with the recovery mode of the current kernel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: w-sky</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-48731</link>
		<dc:creator>w-sky</dc:creator>
		<pubDate>Wed, 16 Dec 2009 05:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-48731</guid>
		<description>There is a much easier and quicker way:

sudo apt-get autoremove

This will scan for absolete kernels and delete them (after user confirmation).</description>
		<content:encoded><![CDATA[<p>There is a much easier and quicker way:</p>
<p>sudo apt-get autoremove</p>
<p>This will scan for absolete kernels and delete them (after user confirmation).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-47034</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Sat, 24 Oct 2009 12:53:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-47034</guid>
		<description>dpkg -l &quot;*image*&quot;
or
dpkg -l \*image\*

less typing;  though grep is great</description>
		<content:encoded><![CDATA[<p>dpkg -l &#8220;*image*&#8221;<br />
or<br />
dpkg -l \*image\*</p>
<p>less typing;  though grep is great</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Debianero</title>
		<link>http://www.foogazi.com/2008/07/02/quickzi-how-to-remove-older-kernels-from-ubuntu/comment-page-1/#comment-19248</link>
		<dc:creator>Debianero</dc:creator>
		<pubDate>Thu, 03 Jul 2008 17:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.foogazi.com/?p=254#comment-19248</guid>
		<description>Another interesting command is &#039;apt-cache policy&#039; which gives more information than &#039;dpkg -l&#039;</description>
		<content:encoded><![CDATA[<p>Another interesting command is &#8216;apt-cache policy&#8217; which gives more information than &#8216;dpkg -l&#8217;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
