8.7. Automatically subscribing any future kernel to the live patching stream


You can use the kpatch-dnf DNF plugin to subscribe your system to fixes delivered by the kernel patch module, also known as kernel live patches. The plugin enables automatic subscription for any kernel the system currently uses, and also for kernels to-be-installed in the future.

Prerequisites

  • You have root permissions on the system.

Procedure

  1. Optional: Check all installed kernels and the kernel you are currently running:

    # dnf list installed | grep kernel
    Updating Subscription Management repositories.
    Installed Packages
    ...
    kernel-core.x86_64            6.12.0-55.9.1.el10              @beaker-BaseOS
    kernel-core.x86_64            6.12.0-55.9.1.el10              @@commandline
    ...
    
    # uname -r
    6.12.0-55.9.1.el10_0.x86_64
  2. Install the kpatch-dnf plugin:

    # dnf install kpatch-dnf
  3. Enable automatic subscription to kernel live patches:

    # dnf kpatch auto
    Updating Subscription Management repositories.
    Last metadata expiration check: 1:38:21 ago on Fri 17 Sep 2021 07:29:53 AM EDT.
    Dependencies resolved.
    ==================================================
     Package                             Architecture
    ==================================================
    Installing:
     kpatch-patch-6_12_0-1               x86_64
     kpatch-patch-6_12_0-2               x86_64
    
    Transaction Summary
    ===================================================
    Install  2 Packages
    …​

    This command subscribes all currently installed kernels to receiving kernel live patches. The command also installs and applies the latest cumulative live patches, if any, for all installed kernels.

    When you update the kernel, live patches are installed automatically during the new kernel installation process.

    The kernel patch module is also installed into the /var/lib/kpatch/ directory that is loaded by the systemd system and service manager during future reboots.

    注意

    An empty live patching package will be installed when there are no live patches available for a given kernel. An empty live patching package will have a kpatch_version-kpatch_release of 0-0, for example kpatch-patch-6_12_0-1-0-0.el10.x86_64.rpm.

    The installation of the empty RPM subscribes the system to all future live patches for the given kernel.

Verification

  • Verify that all installed kernels are patched:

    # kpatch list
    Loaded patch modules:
    kpatch_6_12_0_2_0_1 [enabled]
    
    Installed patch modules:
    kpatch_6_12_0_1_0_1 (6.12.0-0.el10.x86_64)
    kpatch_6_12_0_2_0_1 (6.12.0-0.el10.x86_64)

    The output shows that both the kernel you are running, and the other installed kernel have been patched with fixes from kpatch-patch-6_12_0-1-0-1.el10.x86_64.rpm and kpatch-patch-6_12_0-2-0-1.el10.x86_64.rpm packages.

    注意

    Entering the kpatch list command does not return an empty live patching package. Use the rpm -qa | grep kpatch command instead.

    # rpm -qa | grep kpatch
    kpatch-dnf-0.9.7_0.4-4.el10.noarch
    kpatch-0.9.7-4.el10.noarch
    kpatch-patch-6_12_0_1-0-0.el10_0.x86_64
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部