<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>apt &#8211; acm&#039;s blog</title>
	<atom:link href="https://blog.acm.idv.tw/tag/apt/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.acm.idv.tw</link>
	<description>技術與生活隨筆</description>
	<lastBuildDate>Mon, 25 Jul 2022 09:05:59 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>

<image>
	<url>https://blog.acm.idv.tw/wp-content/uploads/2022/06/cropped-logo_kaffa9-3-32x32.png</url>
	<title>apt &#8211; acm&#039;s blog</title>
	<link>https://blog.acm.idv.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>apt upgrade因/boot空間不足導致更新失敗問題</title>
		<link>https://blog.acm.idv.tw/2022/07/25/apt-upgrade%e5%9b%a0-boot%e7%a9%ba%e9%96%93%e4%b8%8d%e8%b6%b3%e5%b0%8e%e8%87%b4%e6%9b%b4%e6%96%b0%e5%a4%b1%e6%95%97%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.acm.idv.tw/2022/07/25/apt-upgrade%e5%9b%a0-boot%e7%a9%ba%e9%96%93%e4%b8%8d%e8%b6%b3%e5%b0%8e%e8%87%b4%e6%9b%b4%e6%96%b0%e5%a4%b1%e6%95%97%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[kaffa9]]></dc:creator>
		<pubDate>Mon, 25 Jul 2022 09:05:59 +0000</pubDate>
				<category><![CDATA[技術]]></category>
		<category><![CDATA[系統維運]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://kaffa9.com/?p=592</guid>

					<description><![CDATA[近期在為幾台運行Ubuntu的機器使用apt upgrade進行套件更新時，遇到了/boot空間不足，導致更新失敗的問題，折騰了一下子，總算是將問題解決了，在此...<p class="read-more"><a class="btn btn-default" href="https://blog.acm.idv.tw/2022/07/25/apt-upgrade%e5%9b%a0-boot%e7%a9%ba%e9%96%93%e4%b8%8d%e8%b6%b3%e5%b0%8e%e8%87%b4%e6%9b%b4%e6%96%b0%e5%a4%b1%e6%95%97%e5%95%8f%e9%a1%8c/"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>近期在為幾台運行Ubuntu的機器使用apt upgrade進行套件更新時，遇到了/boot空間不足，導致更新失敗的問題，折騰了一下子，總算是將問題解決了，在此做個筆記。</p>



<h2 class="wp-block-heading">問題</h2>



<p>我們使用基本apt工具進行更新：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">apt update
apt upgrade</pre>



<p>若更新的套件包含linux-image-x.x.x.x-generic，且/boot（通常為獨立的分割區）空間不足，將無法完成更新。</p>



<span id="more-592"></span>



<h2 class="wp-block-heading">解法</h2>



<p>將較舊版且<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color"><strong>非目前使用中</strong></mark>的linux kernel移除。</p>



<h3 class="wp-block-heading">查詢當前kernel版本</h3>



<p>使用下列指令查詢目前使用的kernel版本：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">uname -r</pre>



<h3 class="wp-block-heading">查詢已安裝的kernel</h3>



<p>使用下列指令查目前作業系統中，安裝了哪些版本的kernel：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">dpkg --list | grep linux-image</pre>



<h3 class="wp-block-heading">移除舊版kernel</h3>



<p>因前一動 (apt upgrade) 還卡著，因此不管是 apt remove 或 apt purge 應該都無法移除linux-image-x.x.x.x-generic套件，需改用dpkg：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">dpkg -r linux-image-x.x.x.x-generic</pre>



<p>一般來說，應該會有另一個名為linux-modules-x.x.x.x-generic的套件和linux-image-x.x.x.x-generic會有相依關係，也必須一併移除。</p>



<p>移除之後，/boot將會騰出一些空間，就可以繼續進行apt upgrade了。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.acm.idv.tw/2022/07/25/apt-upgrade%e5%9b%a0-boot%e7%a9%ba%e9%96%93%e4%b8%8d%e8%b6%b3%e5%b0%8e%e8%87%b4%e6%9b%b4%e6%96%b0%e5%a4%b1%e6%95%97%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>apt更換mirror站台後遭遇GPG NO_PUBKEY問題</title>
		<link>https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[kaffa9]]></dc:creator>
		<pubDate>Sun, 17 Jul 2022 07:28:49 +0000</pubDate>
				<category><![CDATA[系統維運]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://kaffa9.com/?p=172</guid>

					<description><![CDATA[前一陣子購入了一批Raspberry Pi Desktop Kit，隨附的記憶卡中已經預先裝載好Raspbian，沒想到近日在更新套件時，頻頻遇到某某套件無法更...<p class="read-more"><a class="btn btn-default" href="https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>前一陣子購入了一批Raspberry Pi Desktop Kit，隨附的記憶卡中已經預先裝載好Raspbian，沒想到近日在更新套件時，頻頻遇到某某套件無法更新的問題，apt錯誤訊息建議使用&#8211;fix-missing參數，實際執行完全無法解決問題。重新下了apt-get upgrade觀察了一下，發現更新失敗幾乎都是連不上某台伺服器（所以無法下載套件）造成的，於是心生一計──修改apt source list裡的URL，改為指向mirror site試試。</p>



<span id="more-172"></span>



<p>修改完後，想不到下了apt update直接告訴我GPG Error，這次是NO_PUBKEY的訊息。拜完谷歌大神，很快就得到答案：</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p><a href="https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey">https://askubuntu.com/questions/13065/how-do-i-fix-the-gpg-error-no-pubkey</a></p></blockquote>



<p>方法1：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys &lt;PUBKEY>
# &lt;PUBKEY> 為apt回應的NO_PUBKEY錯誤訊息中的金鑰值</pre>



<p>方法2：</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo gpg --keyserver pgpkeys.mit.edu --recv-key  &lt;PUBKEY>
# &lt;PUBKEY> 為apt回應的NO_PUBKEY錯誤訊息中的金鑰值
sudo gpg -a --export &lt;PUBKEY> | sudo apt-key add -
sudo apt-get update</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.acm.idv.tw/2022/07/17/apt%e6%9b%b4%e6%8f%9bmirror%e7%ab%99%e5%8f%b0%e5%be%8c%e9%81%ad%e9%81%87gpg-no_pubkey%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
