From Fedora Project Wiki

Linux vanilla kernels for Fedora

The kernel vanilla repositories allow you to quickly, comfortably, and cleanly install the latest upstream Linux kernels on Fedora Linux. Seven 'coprs' offer various ready-to-use kernel packages built from upstream Linux series like 'mainline' and 'stable'. The provided RPMs are ideal for both quick tests and regular day-to-day use.

To simply install the latest kernel version intended for end users, follow the instructions in the 'Quick start: install the newest Linux version'; if you instead want to install the latest version from a series such as mainline or next, head over to 'Detailed instructions for installing and uninstalling vanilla kernels'. Note, both sections are meant for users of Fedora variants like Workstation, KDE Plasma Desktop, or Server; in case you are using a Fedora Atomic variant like Silverblue or Kinoite, head over to 'Instructions for Fedora Atomic variants'.

Quick start: install the newest Linux version

To install the latest kernel meant for end users, run the following commands:

sudo dnf -y copr enable @kernel-vanilla/stable
sudo dnf upgrade 'kernel*'
mokutil --sb-state

The first command enables the '@kernel-vanilla/stable' copr, from which the second command will then install the latest Linux version meant for end users -- the one kernel.org prominently advertises in a yellow box.

The third command will tell you if UEFI Secure Boot is active. If that's the case, you have to either disable it in your system's BIOS Setup or through a process initiated by mokutil --disable-validation; 'Disable UEFI Secure Boot' explains this in more detail below. This sadly is often required, as Secure Boot will otherwise reject booting the kernels from the vanilla coprs.

Detailed instructions for installing and uninstalling vanilla kernel packages

The following subsections describe how to choose a kernel vanilla copr for your use case and then install a kernel from it, as well as uninstalling everything cleanly later.

Choose the kernel vanilla copr matching your needs

First decide which of the seven @kernel-vanilla coprs provides the kernel series you want to use – either through the table below or the kernel vanilla repostatus file, which shows the Linux versions the coprs currently ship.

copr provided kernels example version sequence target users
@kernel-vanilla/fedora The latest kernel version from the series your Fedora Linux release currently uses or will receive as update within a few days; for stable releases of Fedora Linux this is the latest stable series or its predecessor, as long as it is still supported. …, 6.0.18,
6.0.19,
6.1.5,
6.1.6, …
This copr allows checking if a bug that happens with Fedora's kernel also occurs with the latest upstream version from the same kernel series or the one you will retrieve within days.
@kernel-vanilla/fedora-rc Pre-releases of the next release from the stable series the relevant Fedora Linux release currently uses or will likely receive within a few days; for stable releases of Fedora Linux this is the latest stable series or its predecessor. …, 6.0.18,
6.0.19-rc1,
6.0.19,
6.1.5-rc1,
6.1.5, …
Anyone who wants to help testing Linux kernel version from the latest stable series or its predecessor about to be released.
@kernel-vanilla/stable The latest kernel version meant for regular end users; usually this is the newest version from the latest stable series, occasionally the latest mainline release. …, 6.0.15,
6.1,
6.1.1,
6.1.2, …
Anyone who wants the latest and greatest kernel intended for regular users.
@kernel-vanilla/stable-rc Pre-releases of the next release from the latest stable series. …, 6.0.15-rc1,
6.0.15,
6.1,
6.1.1-rc1,
6.1.1, …
Anyone who wants to help testing Linux kernel version from the latest stable series about to be released.
@kernel-vanilla/mainline-wo-mergew The latest mainline kernel, either built from a pre-release (aka "rc kernel") or a Git snapshot of the day – albeit the latter only after -rc1 was released. …, 6.1-rc8-20221211,
6.1,
6.1.1-rc1,
6.1.1,
6.2-rc1,
6.2-rc1-20221226, …
Anyone who wants to run a kernel built from the latest Linux codebase, except when mainline is in a 'merge window' – that is the phase right after a new mainline release (say 6.1) when the bulk of changes (including all riskier ones!) are merged for the next mainline version; this phase ends after two weeks with the publication of the next mainline kernel's first pre-release (e.g. 6.2-rc1).
@kernel-vanilla/mainline The latest mainline kernel build from a Git snapshot of the day. …, 6.1-rc8-20221211,
6.1,
6.2-rc0-20221213,
6.2-rc0-20221214, …
Anyone who wants to run kernels built from the latest Linux codebase.
@kernel-vanilla/next Linux-next kernels. …, 6.1-0.0.next.20221209,
6.2-0.0.next.20221212,
6.2-0.0.next.20221213, …
Anyone who wants to run linux-next or test if the changes slated for inclusion in the next mainline cycle fix a problem.
@kernel-vanilla copr dependency graph
dependency graph for the @kernel-vanilla coprs

Note, only the coprs 'fedora' and 'next' are stand-alone. The other five each include at least one other copr as a runtime dependency which is required for proper function; hence, enable it when DNF asks while setting up a kernel vanilla copr. The package manager will then later pick the newest kernel it finds in the dependency chain. This allows serving multiple use cases without having to build one kernel version multiple times.

A few examples explain the concept best:

  • Users of the 'mainline' copr outside of merge windows will receive daily snapshots from the 'mainline-wo-mergew' repo.
  • Users of the 'mainline-wo-mergew' copr during merge windows will receive a kernel from the 'stable-rc' or 'stable' repos in case they ship newer versions -- say in case 6.0.1 is prepared and released shortly after 6.0 went out.
  • When no stable series -rc is out for testing, users of the 'stable-rc' copr will receive packages from the 'stable' copr, as those might resolve problems fixed in between (e.g., between 6.0.2-rc1 and 6.0.2). The 'fedora-rc' works the same with the help of the 'fedora' copr.
  • When a Fedora version uses kernels from the latest stable series by default (say 6.0.5 and later), users of the 'stable' copr will receive packages from the 'fedora' copr.

Another note relevant for users of Fedora versions in development, e.g., rawhide and beta releases: be aware that these coprs will not provide kernel versions older than the ones your particular Fedora Linux uses by default. Rawhide, for example, regularly uses a latest mainline snapshot; that's why rawhide users will receive vanilla mainline snapshots all the time as well, even if they choose the 'stable' or 'mainline-wo-mergew' coprs. Users of Fedora pre-releases (e.g., beta versions) might see similar effects, but things will automatically start to work as described a few weeks before the Fedora releases the final.

Install a kernel from the chosen copr

Enable the kernel vanilla copr you decided to use – for example the one shipping a kernel built from the latest 'mainline' code:

sudo dnf -y copr enable @kernel-vanilla/mainline

Now update your system to install the latest package from the copr:

sudo dnf upgrade 'kernel*'

If you're on a x86-64 (aka AMD64) system, execute the following command as well:

mokutil --sb-state

If it says 'SecureBoot enabled', you will have to turn it off either in your BIOS Setup as explained in 'the next section'; if it says 'SecureBoot disabled', skip it and continue at 'Things to do after setting things up'.

Disable UEFI Secure Boot

It currently is technically impossible to securely sign the kernels from the vanilla coprs in a way that typical UEFI Secure Boot implementation of x86-64 systems will trust them out of the box. Most of those will thus reject booting kernels from these coprs. To do so, you thus must disable UEFI Secure Boot. There are two ways to do so:

1) Disable UEFI Secure Boot in your BIOS Setup.

2) Disable UEFI Secure Boot enforcement in your Linux environments by executing these steps:

  • Run sudo mokutil --disable-validation; this will query a one-time password with 8 to 16 characters you want to write down.
  • Reboot.
  • When prompted, press a key to perform MOK management.
  • Select 'Change Secure Boot state'.
  • Enter each requested character of your chosen one-time password to confirm the change. Note: you have to press Enter/Return after each character.
  • Select 'Yes'.
  • Select 'Reboot'.

Things to do after setting things up

Once you have booted your vanilla kernel, you have two options:

1) In case you want to use the chosen copr regularly, be aware that for frequently updated kernel vanilla coprs like 'mainline', there is quite a risk that DNF misses the latest kernels and installs obsolete ones. To prevent that, tell DNF to check the kernel vanilla repositories more often than usual with a command like this one:

sudo sed -i 's!baseurl=https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/\(mainline\|stable-rc\|next\).*!&\nmetadata_expire=1h!g; s!baseurl=https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/\(stable\|fedora\)/.*!&\nmetadata_expire=3h!g;' /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:group_kernel-vanilla:*.repo

2) In case you installed a vanilla kernel just for a quick test, consider removing the just configured copr immediately; at a later point then uninstall any kernels installed from them.

Remove kernel vanilla coprs

If you don't want to receive any more kernels from the vanilla coprs anymore, remove their configuration:

dnf copr list | grep -Eo '@kernel-vanilla/[^ ]+ ' | xargs -r sudo dnf copr remove

To switch back to Fedora's default kernel immediately or at a later point, follow the next section, too.

Remove any kernels installed from the kernel vanilla repositories

Start switching back to Fedora's default kernel by downgrading your kernel and a few related packages to the latest versions Fedora provides; note, this command might not do anything in case you already have Fedora's latest kernel installed.

sudo dnf --refresh distro-sync $(rpm -qa 'kernel*' 'libperf*' perf python3-perf rtla rv --qf '%{name} \n' | sort -u)

It's not strictly required, but highly recommended to boot into the latest official Fedora kernel now. To do so, restart and choose the topmost kernel from the boot menu that does not have 'vanilla' in the name.

Now remove all kernels installed from the kernel vanilla coprs:

rpm -qa 'kernel' 'kernel*core*' 'kernel*modules*' 'kernel*devel*' | grep '.vanilla' | xargs -r sudo dnf remove

If you disabled UEFI Secure Boot, you might want to turn it on again using the path you took to disable it, e.g., either through your BIOS Setup or a process initiated with sudo mokutil --enable-validation.

From now on your system will behave like one that never had these repositories enabled or kernels installed from it.

Instructions for Fedora Atomic variants

Important note: the following instructions only work as intended for the @kernel-vanilla coprs 'fedora' and 'next', as those are stand-alone and do not depend on other coprs. The instructions most of the time will do the right thing on 'mainline-wo-mergew' copr as well; but with the other @kernel-vanilla coprs the system will often install and remain on obsolete kernel versions for a few days (in case of 'stable-rc') or quite a few weeks ('stable' and 'mainline' ). That's because the latest versions suitable for users of those coprs in about 60 to 90 percent of the time are distributed through a higher-level copr (the note under the table above explains this scheme in more detail). DNF automatically uses the latter, but to our knowledge does not enable other repositories a copr depends on.

Use the following commands to install the latest kernel from the 'mainline-wo-mergew' copr on Fedora Atomic Desktops like Silverblue or Kinoite:

copr="mainline-wo-mergew"
curl -s "https://copr.fedorainfracloud.org/coprs/g/kernel-vanilla/${copr}/repo/fedora-rawhide/group_kernel-vanilla-${copr}-fedora-rawhide.repo" | sudo tee "/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:group_kernel-vanilla:${copr}.repo"
sudo rpm-ostree override replace --experimental --from repo="copr:copr.fedorainfracloud.org:group_kernel-vanilla:${copr}" kernel kernel-core kernel-modules kernel-modules-core kernel-modules-extra

To later remove the kernel vanilla packages and the repository configuration, run the following commands:

sudo rpm-ostree override reset kernel kernel-core kernel-modules kernel-modules-core kernel-modules-extra
sudo rm "/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:group_kernel-vanilla"*

How vanilla kernels compare to Fedora's

Most of the time, kernels from the kernel vanilla coprs will work roundabout as well and secure as Fedora's. Sometimes, though, the kernels from these repositories will work better, as they contain drivers or security fixes that haven't reached the kernel used by Fedora Linux yet; other times it's the other way around, as Fedora sometimes includes fixes that upstream hasn't picked up yet. Those differences rarely matter much.

Empty or apparently outdated coprs are normal

Please be aware that at least one and up to three out of the seven kernel vanilla coprs will always look empty or outdated when you look at the copr web interface or straight at the package repositories. That is totally normal, as it will look like that when the most recent build suitable for users of that copr is found in one of the other copr included as a runtime dependency; the note under the above table explains this in more detail.

Linux kernel versions currently offered

The repositories provide packages with a regular kernel (e.g., kernel, kernel-core, kernel-modules, …) for arm64/aarch64, ppc64le, and x86_64; all coprs that ship 6.12-pre or later also provide realtime/PREEMPT_RT packages (e.g. kernel-rt, kernel-rt-core, kernel-rt-modules, …) for arm64/aarch64 and x86_64.

A repostatus file shows the versions the various coprs currently provide. Alternatively, execute the following script to query the latest versions locally:

dists=(41 42 rawhide)
dnf clean all > /dev/null
for repo in fedora{,-rc} fedora stable {fedora,stable}-rc mainline{-wo-mergew,} next; do
    [[ "${repo}" =~ (fedora|next)$ ]] && unset repostring
    repostring="${repostring} --repofrompath=kvr-${repo},https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/${repo}/fedora-\${distro}-x86_64/"
    ( [[ "${repo}" =~ (fedora|fedora-rc) ]] && [[ "${fedorarc_done}" ]] ) && continue
    for distro in ${dists[*]} ; do
        queryresult="$(eval dnf repoquery --quiet ${repostring} --disablerepo=* --enablerepo=kvr-* --latest-limit=1 -q kernel --arch x86_64 --qf '%{version}-%{release}')"
   	   printf '%-20s %-10s %s\n' "${repo}" "${distro}" "${queryresult:-lookup failed}"
    done
    [[ "${repo}" == fedora-rc ]] && fedorarc_done="TRUE"
done

Developers behind the effort and point of contact

A The Linux kernel vanilla repositories for Fedora are maintained by Thorsten Leemhuis (aka "knurd") since late 2012. The packages they provide are built using an RPM spec file that is nearly identical to the one used to build Fedora's kernel; the build environment is basically identical, too. Note, though, that none of the maintainers of the official Fedora Linux kernel are involved in the maintenance of these repositories.

For any feedback or questions regarding the kernel vanilla repositories, contact Thorsten Leemhuis (aka "knurd").

What's the goal of these repositories? And are these kernels as good as Fedora's?

These and many other questions are answered in the FAQ about the Linux kernel vanilla repositories for Fedora Linux.