User:Pietinger/Tutorials/Selecting a convenient kernel version

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it (how to get started).

Tutorial: Selecting a convenient kernel version

This tutorial explains all options for selecting a certain kernel version. Only our Gentoo default sources will be used.

First of all there is a difference what is a stable version in the point of view of Gentoo and kernel developers. Kernel developers flag all kernels not being a release candidate as stable (-rc-versions). This is not true for Gentoo. In Gentoo only kernels which have Long Term Support (LTS) are stable. List of LTS kernels: https://www.kernel.org/category/releases.html

Usually kernels developers create approximately every week a new minor version. See more here: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git (Select latest LTS version in column "Branch")

Not every minor version of a LTS kernel will become stable in Gentoo. Gentoo selects only some of them as stable. This leads to a new version of stable gentoo-sources approximately once in a month. There are 4 options for selecting a kernel version. First, get a list of all current available versions:

List of available kernel version

Best tool for an overview is eix. If not installed use

root #emerge --ask app-portage/eix

Stable versions are coloured in green:

root #eix gentoo-sources

Install Gentoo Sources

Choose one of these options:

Option 1: Choosing a Gentoo stable version

Just install the source without any additional step. This is the easiest way to go and also recommended in our Handbook:AMD64/Installation/Kernel#Installing_the_sources

root #emerge --ask sys-kernel/gentoo-sources

Option 2: Choosing the newest version

In Gentoo terms this is an unstable version. Kernel developers see it stable. Add these lines to /etc/portage/package.accept_keywords (or create this file if it doesnt exist) before emerging gentoo-sources.

FILE /etc/portage/package.accept_keywords
sys-kernel/gentoo-sources ~amd64
sys-kernel/linux-headers ~amd64

Proceed with step in Option 1.

Option 3: Choosing the newest version of current LTS series

This is my recommendation in my point of view for security, because every minor version of current LTS series will be installed. Disadvantage is of course the frequency of new versions. Choose this only if you are willing to update approximately every week.

At the time of writing this article version 5.15.x was the newest available LTS version and 5.16.x was available also. Do the same as explained in Option 2 and additionally add these lines to /etc/portage/package.mask

FILE /etc/portage/package.mask
>=sys-kernel/gentoo-sources-5.16.0
>=sys-kernel/linux-headers-5.16

Proceed with step in Option 1.

Option 4: Choosing a version of a certain series

If there is a reason to stay on an older series combine Option 2 and Option 3 to fulfill your needs.

Finalizing

Check if a softlink /usr/src/linux already exists with

root #ls -l /usr/src

If there is no softlink create it with eselect and proceed with your base installation or configuration training.


Note
This is my first try for creating a wiki article. Maybe some formatting is wrong. Because it is a tutorial and not a reference guide I ignored the standard of not writing in first or second person. Yes, my english is very poor.