Working with Kernels
Revision for “Working with Kernels” created on May 1, 2023 @ 19:06:21
Title | Working with Kernels |
---|---|
Content | <h1><img class="wp-image-4897 aligncenter" src="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/kernal_overview.png?x55737&x55737&x55737" alt="" width="658" height="370" /></h1>
<h1>Background</h1>
<strong>Bodhi Linux</strong> (<strong>Standard</strong>/<strong>AppPack</strong>/<strong>Legacy</strong>) by default, <em>do not</em> automatically check for <strong>kernel</strong> updates during <code>apt update</code>. If you want a different <strong>kernel</strong>, perhaps for security, or perhaps to support some new device or feature that has been added since the <strong>kernel</strong> was originally installed with <strong>Bodhi Linux</strong> (<em>or so others don't hassle you when they see a screenshot with a kernel that isn't the very latest</em>), there are several options.
<em>Note:<strong> Bodhi Linux HWE</strong> (Hardware Enablement), </em>does<em> receive kernel updates</em>
<h4><strong>Bodhi Linux's Lead Developer <a class="user-link js-user-link user-2 group-4" title="@ylee" href="https://bodhilinux.boards.net/user/2">ylee</a></strong>:</h4>
<em>"The decision to not forcing kernel updates on users was Jeff Hoogland's decision made a long time at the beginning of this distro. Traditionally we have left this decision to the end User. Jeff's reasoning was that kernel updates can sometimes break things, usually as in lose hardware support. I have merely continued this tradition with the two releases I have made.</em>
<em>Are you less secure if you do not update your kernel? In some cases clearly yes. The security of your system is your responsibility. I pay close attention to kernel updates myself. Even read the changelogs. I stick with Ubuntu kernels usually but I do update the kernel."</em>
<div></div>
<div>
<h3>Option 1: Upgrade to the latest point release of the version Bodhi Linux shipped with</h3>
Point releases fix bugs and address security issues, but rarely add any features or break working hardware. For example Bodhi Linux Standard [library term="version"]comes with 5.4.0-72, while this option provides 5.4.0-90. Keeping this up to date is mainly for security; the only real disadvantage is it takes bandwidth, time, and requires a reboot to take affect.
<h3>Option 2: Upgrade to the HWE Rolling Update Kernel</h3>
<em>Note: This does not apply to Bodhi Linux 6 Legacy; this section will be updated once out of beta which is using Debian kernel 5.10</em>
The "<strong>Hardware Enablement</strong>" <strong>kernel</strong> (<strong>HWE</strong>) is mainly available to <em>support</em> brand <strong>new hardware</strong> that was <em>not supported</em> when the <strong>Bodhi Linux's original kernel</strong> was released, or if a new feature was introduced in a <strong>later</strong> <strong>kernel</strong> you want to take advantage of (<em>...or you like bigger numbers when you look at your system info</em>). The only real disadvantage is it takes time, data, and a <em>reboot</em> to update, though it is possible that a <strong>newer kernel version</strong> could <em>drop support</em> for <strong>hardware that was previously supported</strong>, or that an <strong>older driver</strong> <em>does not work</em> with the <strong>newer kernel version</strong>.
<strong>Bodhi Linux 4</strong>: <code>4.15</code>
<strong>Bodhi Linux 5</strong>: <code>5.4</code>
<strong>Bodhi Linux 6:</strong> <code>5.13</code> (<em>could possibly increase; previously</em> <code>5.8</code> and <code>5.11</code>)
</div>
<div>
<h3><b>Option 3: Upgrade to an <a href="http://redirect.viglink.com?key=71fe2139a887ad501313cd8cce3053c5&subId=7156301&u=https%3A//wiki.ubuntu.com/Kernel/OEMKernel" target="_blank" rel="nofollow noopener">OEM Kernel</a></b></h3>
</div>
<div>
<em>Note: this only applies to 64-bit Bodhi Linux [library term="version"]</em>
<strong>Ubuntu</strong> appears to make these <strong>kernels</strong> available for equipment manufacturers who need <strong>even newer kernel </strong>than<strong> HWE</strong>, <em>updating</em> them <strong>every 3 weeks</strong>. As of now, there are <strong>meta-packages</strong> for <strong>kernel versions</strong> <code>5.10</code>, <code>5.13</code>, and <code>5.14</code> in <strong>Focal</strong> <strong>repositories</strong>.
</div>
<h3>Option 4: Install any version of mainline kernel compiled by Ubuntu</h3>
<div>
These are <strong>pure upstream kernels</strong> (<em>built using <strong>Ubuntu</strong> kernel configuration files</em>), with <strong>very new</strong> and <strong>very old</strong> available. They <em>do not</em> include any <strong>Ubuntu-specific drivers</strong> or <strong>patches</strong>, <em>nor</em> any <strong>proprietary modules</strong> or <strong>restricted binary drivers</strong>.
<h1>How To: GUI Method - Update Manager</h1>
</div>
<div>
<div>
<b> </b>If you <em>do not</em> have it installed already, <em>install</em> <strong>Update Manager</strong>:
</div>
<div>
<pre>sudo apt install mintupdate</pre>
</div>
<div>
For <strong>mainline kernels only</strong> (option 4), <em>select <strong>Edit > Preferences > Expert</strong></em> and <em>check</em> the <strong>box t</strong>o enable them.
<img class="alignnone wp-image-4900" src="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/updtmgr.png?x55737&x55737&x55737" alt="" width="700" height="567" />
For the <strong>older 4.x kernels</strong>, also <em>check</em> <strong>long term support</strong>.
<strong><em>Tools > Kernel Manager</em></strong>
<img class="alignnone wp-image-4901" src="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/krnlmgr.png?x55737&x55737&x55737" alt="" width="699" height="479" />
<strong><em>
</em></strong>Select the <strong>kernel</strong> you want and <em>click</em> <strong>install</strong>. The specific <strong>version</strong> you <em>select</em> will be <em>installed</em> by the <strong>update manager,</strong> which <em>will not</em> affect future <code>apt updates</code>.
</div>
</div>
<h1>How To: Alternative Method - Using Command Line</h1>
<div>
<div>
First, using <a href="https://www.bodhilinux.com/w/terminology/">Terminology</a> (or your favorite <strong>terminal emulator</strong>), make sure your <strong>package database</strong> is up to date:
</div>
<div>
<pre>sudo apt update</pre>
</div>
<div>
If you follow the instructions in <strong>Options 1-3</strong> below, future <code>apt updates</code> will periodically include an <strong>updated kernel</strong>. Unlike using <strong>MintUpdate</strong> (<em>as described above</em>) to <em>install</em> a <strong>specific version</strong>, or <em>specifying</em> a <strong>specific version</strong> with <code>apt install</code>, the following method will affect future <code>apt updates</code>.
</div>
<div></div>
<h3>Option 1: Enable & Install Updates</h3>
<div>
<em>Note: This does not apply to Bodhi Linux 6 Legacy; this section will be updated once out of beta which is using Debian kernel 5.10</em>
<em>Note 2: This will update Bodhi Linux 5 Legacy from Debian kernel 4.9 to Ubuntu kernel 4.15</em>
</div>
<pre>sudo apt install linux-image-generic linux-headers-generic</pre>
<h3>Option 2: Enable & Install HWE Updates</h3>
<em>Note: This does not apply to Bodhi Linux 6 Legacy; this section will be updated once out of beta which is using Debian kernel 5.10</em>
Bodhi 4: <code>sudo apt install linux-generic-hwe-16.04 xserver-xorg-hwe-16.04</code>
Bodhi 5: <code>sudo apt install linux-generic-hwe-18.04 xserver-xorg-hwe-18.04</code>
Bodhi 6: <code>sudo apt install linux-generic-hwe-20.04</code>
<h3><b>Option 3: Enable & Install OEM Updates
</b></h3>
<div>
<em>Note: this only applies to 64-bit Bodhi Linux 6</em>
</div>
<div>
First <em>check</em> what is <strong>available</strong>:
</div>
<div>
<pre>apt search linux-oem* "kernel and headers"</pre>
<img class="alignnone wp-image-4904" src="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/oemkrnl.png?x55737&x55737&x55737" alt="" width="772" height="444" />
Then <em>install</em> the <strong>meta package</strong> with the <strong>kernel</strong> you want, for example for <strong>kernel version</strong> <code>5.14</code> on <strong>Bodhi</strong> <strong>Linux</strong> <strong>[library term="version"]</strong>:
</div>
<div>
<pre>sudo apt install linux-oem-20.04d</pre>
</div>
<h3><b><b>Option 4: Mainline
</b></b></h3>
<div>
<em>Download</em> <strong>mainline kernel packages</strong> from <a href="http://redirect.viglink.com?key=71fe2139a887ad501313cd8cce3053c5&subId=7156301&u=https%3A//kernel.ubuntu.com/%7Ekernel-ppa/mainline/%3FC%3DN%3BO%3DD" target="_blank" rel="nofollow noopener">Ubuntu Mainline Kernel Archive</a>, then <em>install</em> <strong>manually</strong>.
</div>
<div></div>
<div>Example installation of <code>4.19.217</code> for <code>i386</code> (<strong>Bodhi Linux Legacy</strong>)</div>
<pre><b>mkdir /tmp/whatever;cd /tmp/whatever
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.217/amd64/linux-headers-4.19.217-0419217_4.19.217-0419217.202111121443_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.217/i386/linux-headers-4.19.217-0419217-generic_4.19.217-0419217.202111121443_i386.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.217/i386/linux-image-4.19.217-0419217-generic_4.19.217-0419217.202111121443_i386.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19.217/i386/linux-modules-4.19.217-0419217-generic_4.19.217-0419217.202111121443_i386.deb
sudo apt install ./*</b></pre>
<h1>Reboot to Use Replacement Kernel</h1>
<div>
Regardless how you installed, <strong>GRUB</strong> will <em>automatically boot</em> the <strong>newest kernel</strong> of the <strong>newest kernel series</strong> you have installed*. If you want to boot an <strong>older version</strong>, <strong>GRUB</strong> will <em>not</em> boot it <em>automatically</em> (unless you <em>configure</em> it that way), so select it directly from <strong>advanced options</strong>.
<em>*Hint: the latest minor version of an older kernel series, can sometimes be newer than the latest minor version of a newer kernel series. In that case, Grub will still automatically boot the latter.</em>
</div>
<div>
If for some reason your system <em>fails to boot</em> with the <strong>alternate kernel</strong>, <strong>force</strong> a <em>reboot</em> and <em>select</em> <strong>advanced options</strong> from <strong>GRUB</strong>, find your <strong>previous</strong> <strong>known-working kernel</strong> which you can <em>boot</em>, and use it to <em>remove</em> the <strong>kernel </strong>that <em>does not work</em>.
<a href="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/grubkrnl.png?x55737&x55737&x55737"><img class="alignnone size-full wp-image-4912" src="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/grubkrnl.png?x55737&x55737&x55737" alt="" width="640" height="480" /></a>
<a href="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/grubkrnlmlti.png?x55737&x55737&x55737"><img class="alignnone wp-image-4913" src="https://www.bodhilinux.com/trial/wp-content/uploads/2021/11/grubkrnlmlti.png?x55737&x55737&x55737" alt="" width="639" height="479" /></a>
<a href="https://www.bodhilinux.com/">Bodhi Linux Home</a>
<a href="https://www.bodhilinux.com/w/wiki/">Bodhi Linux – Wiki Home Page</a>
<a href="https://www.bodhilinux.com/w/bodhi-linux-how-to/">Bodhi Linux – Wiki Table of Contents</a>
</div>
</div> |
Excerpt |