<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pacman on Cyrus Yip's blog</title><link>https://cyrusyip.org/en/tags/pacman/</link><description>Recent content in pacman on Cyrus Yip's blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 01 Sep 2022 21:07:16 +0800</lastBuildDate><atom:link href="https://cyrusyip.org/en/tags/pacman/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Ignore Kernel Upgrades on Arch Linux</title><link>https://cyrusyip.org/en/posts/2022/06/30/ignore-kernel-upgrades-on-arch/</link><pubDate>Thu, 30 Jun 2022 00:00:00 +0800</pubDate><guid>https://cyrusyip.org/en/posts/2022/06/30/ignore-kernel-upgrades-on-arch/</guid><description>&lt;p&gt;Warning: Ignoring kernel upgrades makes the system more vulnerable due to the lack of the latest security fixes.&lt;/p&gt;
&lt;h2 class="heading" id="ignore-temporarily"&gt;
 Ignore Temporarily&lt;span class="heading__anchor"&gt; &lt;a href="#ignore-temporarily"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;p&gt;Pacman&amp;rsquo;s &lt;code&gt;--ignore&lt;/code&gt; option is used to ignore package upgrades. You can ignore multiple packages, separated by commas. This command upgrades the system but ignores three kernels.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo pacman -Syu --ignore linux,linux-header,linux-lts,linux-lts-headers,linux-zen,linux-zen-headers
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 class="heading" id="ignore-permanently"&gt;
 Ignore Permanently&lt;span class="heading__anchor"&gt; &lt;a href="#ignore-permanently"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;p&gt;Typing &lt;code&gt;--ignore packages&lt;/code&gt; takes some time&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;. Sometimes, you might forget to type it. You can permanently ignore kernel upgrades by adding this to &lt;code&gt;/etc/pacman.conf&lt;/code&gt; in the &lt;code&gt;[options]&lt;/code&gt; section.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IgnorePkg = linux linux-headers linux-lts linux-lts-headers linux-zen linux-zen-headers
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Note that packages in &lt;code&gt;IgnorePkg&lt;/code&gt; are separated by spaces. If you want to upgrade kernels after configuring &lt;code&gt;IgnorePkg&lt;/code&gt;, install them explicitly:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;span class="lnt"&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo pacman -Syu --needed linux linux-headers linux-lts linux-lts-headers linux-zen linux-zen-headers
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# or use brace expansion&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo pacman -Syu --needed linux&lt;span class="o"&gt;{&lt;/span&gt;,-lts,-zen&lt;span class="o"&gt;}{&lt;/span&gt;,-headers&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 class="heading" id="about-partial-upgrades"&gt;
 About Partial Upgrades&lt;span class="heading__anchor"&gt; &lt;a href="#about-partial-upgrades"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href="https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported"&gt;Partial upgrades are unsupported on Arch Linux&lt;/a&gt;. That means if you install or upgrade some package(s) without upgrading other packages, the system might break. For example, these commands might break the system.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pacman -Sy; pacman -S package
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pacman -Sy package
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;I think ignoring kernel upgrades does not break the system because Linux software works with different versions of the kernel. Sometimes, I ignore kernel upgrades for a week and have no problems at all.&lt;/p&gt;
&lt;h2 class="heading" id="why-i-ignore-kernel-upgrades"&gt;
 Why I Ignore Kernel Upgrades&lt;span class="heading__anchor"&gt; &lt;a href="#why-i-ignore-kernel-upgrades"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;
&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1
&lt;/span&gt;&lt;span class="lnt"&gt;2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class="lntd"&gt;
&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-gdscript3" data-lang="gdscript3"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;❯&lt;/span&gt; &lt;span class="n"&gt;head&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;pacman&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2021&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;09&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="n"&gt;T11&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;0000&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;PACMAN&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;Running&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;pacman -r /mnt -Sy --cachedir=/mnt/var/cache/pacman/pkg --noconfirm base base-devel linux linux-firmware dhcpcd iwd vim nano sudo bash-completion&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;I have been using Arch Linux since September 30, 2021. I am a happy user most of the time. I love its update-to-date packages. The only thing annoying me is kernel upgrades. I installed three Linux kernels (stable, longterm, and zen kernel). I usually use zen kernel. It is updated frequently, about every 3 days. Upgrading the current kernel without rebooting breaks some functionalities such as USB and virtualization&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;. Rebooting interrupts my work because I have to close the software and open it after rebooting. Upgrading the kernel is also much slower than upgrading other packages&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;. Thus, I dislike upgrading kernels. I would like to do it when I am free.&lt;/p&gt;
&lt;h2 class="heading" id="acknowledgment"&gt;
 Acknowledgment&lt;span class="heading__anchor"&gt; &lt;a href="#acknowledgment"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;p&gt;I shared this post on &lt;a href="https://www.reddit.com/r/archlinux/comments/x19ebv/how_to_ignore_kernel_upgrades_on_arch_linux/"&gt;Arch Linux subreddit&lt;/a&gt;. People corrected my wrong opinions. I learned a lot from the comments. Thank you.&lt;/p&gt;
&lt;h2 class="heading" id="references"&gt;
 References&lt;span class="heading__anchor"&gt; &lt;a href="#references"&gt;#&lt;/a&gt;&lt;/span&gt;
&lt;/h2&gt;&lt;p&gt;&lt;a href="https://wiki.archlinux.org/title/Pacman#Skip_package_from_being_upgraded"&gt;pacman - Skip package from being upgraded - ArchWiki&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;If you use fish or zsh-autosuggestions, that should not be a problem.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;This problem is caused by missing kernel modules and can be solved by &lt;a href="https://archlinux.org/packages/community/any/kernel-modules-hook/"&gt;kernel-modules-hook&lt;/a&gt;.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;Upgrade time can be reduced by uninstalling extra Dynamic Kernel Module Support (DKMS) modules and kernels. It also saves time installing packages by &lt;code&gt;pacman -S &amp;lt;package&amp;gt;&lt;/code&gt; instead of &lt;code&gt;pacman -Syu &amp;lt;package&amp;gt;&lt;/code&gt;.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item></channel></rss>