#
$ sudo apt update
$ sudo apt install build-essential git libssl-dev libelf-dev flex bison debhelper-compat bc
$ uname -a
Linux thy-Z370-HD3 6.14.0-33-generic #33~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 19 17:02:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ curl -L https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-6.8.2.tar.gz -o linux-6.8.2.tar.gz
$ tar xzf linux-6.8.2.tar.gz
$ curl -L https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/6.8/patch-6.8.2-rt11.patch.xz -o patch-6.8.2-rt11.patch.xz
$ cd linux-6.8.2
$ xzcat ../patch-6.8.2-rt11.patch.xz | patch -p1
...
patching file kernel/time/hrtimer.c
patching file kernel/time/tick-sched.c
patching file kernel/time/timer.c
patching file kernel/trace/trace.c
patching file kernel/trace/trace_output.c
patching file lib/dump_stack.c
patching file localversion-rt
patching file net/core/dev.c
patching file net/core/skbuff.c
$ cp /boot/config-6.14.0-33-generic .config
$ make oldconfig
# choose 5
Preemption Model
1. No Forced Preemption (Server) (PREEMPT_NONE)
> 2. Voluntary Kernel Preemption (Desktop) (PREEMPT_VOLUNTARY)
3. Preemptible Kernel (Low-Latency Desktop) (PREEMPT)
4. Automagic preemption mode with runtime tweaking support (PREEMPT_AUTO) (NEW)
5. Fully Preemptible Kernel (Real-Time) (PREEMPT_RT) (NEW)
choice[1-5?]:
# hit enter until the end
Undefined behaviour sanity checker (UBSAN) [Y/n/?] y
Abort on Sanitizer warnings (smaller kernel but less verbose) (UBSAN_TRAP) [N/y/?] n
Perform array index bounds checking (UBSAN_BOUNDS) [Y/n/?] y
Perform checking for bit-shift overflows (UBSAN_SHIFT) [Y/n/?] y
Perform checking for integer divide-by-zero (UBSAN_DIV_ZERO) [N/y/?] n
Perform checking for non-boolean values used as boolean (UBSAN_BOOL) [Y/n/?] y
Perform checking for out of bounds enum values (UBSAN_ENUM) [Y/n/?] y
Perform checking for misaligned pointer usage (UBSAN_ALIGNMENT) [N/y/?] n
Enable instrumentation for the entire kernel (UBSAN_SANITIZE_ALL) [Y/n/?] (NEW)
Module for testing for undefined behavior detection (TEST_UBSAN) [N/m/?] n
#
# configuration written to .config
#
# delete value as below
CONFIG_SYSTEM_TRUSTED_KEYS=""
CONFIG_MODULE_SIG_KEY=""
CONFIG_SYSTEM_REVOCATION_KEYS=""
# comment out
CONFIG_MODULE_SIG_FORCE
CONFIG_DEBUG_INFO_BTF
CONFIG_MODULE_SIG_ALL
$ nproc
12
# $ make -j4 deb-pkg
$ make -j4 bindeb-pkg
$ ls ../ | grep '6.8.2'
...
linux-headers-6.8.2-rt11_6.8.2-1_amd64.deb
linux-image-6.8.2-rt11_6.8.2-1_amd64.deb
linux-image-6.8.2-rt11-dbg_6.8.2-1_amd64.deb
linux-libc-dev_6.8.2-1_amd64.deb
...
$ sudo dpkg -i ../linux-headers-6.8.2-rt11_6.8.2-1_amd64.deb ../linux-image-6.8.2-rt11_6.8.2-1_amd64.deb ../linux-libc-dev_6.8.2-1_amd64.deb
...
Found linux image: /boot/vmlinuz-6.11.0-17-generic
Found initrd image: /boot/initrd.img-6.11.0-17-generic
Found linux image: /boot/vmlinuz-6.8.2-rt11
Found initrd image: /boot/initrd.img-6.8.2-rt11
Found linux image: /boot/vmlinuz-6.8.0-52-generic
Found initrd image: /boot/initrd.img-6.8.0-52-generic
Adding boot menu entry for UEFI Firmware Settings ...
done
Setting up linux-libc-dev:amd64 (6.8.2-1) ...
$ sudo vim /boot/grub/grub.cfg
# find menuentry `'Ubuntu, with Linux 6.8.2-rt11'`
$ sudo vim /etc/default/grub
# change `GRUB_DEFAULT` to the found entry
# GRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 6.8.2-rt11'
$ uname -a
Linux thy-Z370-HD3 6.8.2-rt11 #1 SMP PREEMPT_RT Tue Oct 28 16:56:00 KST 2025 x86_64 x86_64 x86_64 GNU/Linux