Debian 12下无需安装实时内核使用WireGuard的方法咨询
嗨,我完全理解你不想切换到实时内核的顾虑——其实完全可以在你当前的6.1.0-13-amd64内核上正常使用WireGuard,不用被迫安装额外的实时内核包。
先说说为什么你执行apt install wireguard会触发实时内核的安装:因为wireguard是一个元包(meta-package),它的依赖配置里包含了实时内核相关的包,但实际上Debian 12的默认通用内核已经内置了WireGuard的内核模块,我们根本不需要这个元包,只需要安装用户态的工具即可。
具体操作步骤如下:
先确认你的当前内核已经自带WireGuard模块:
执行命令:modprobe wireguard
如果没有任何报错输出,就说明模块已经存在,可以正常使用。直接安装WireGuard的用户态工具包,而不是
wireguard元包:
执行命令:apt install wireguard-tools --no-install-recommends
这个命令只会安装WireGuard的配置、管理工具,不会拉取任何额外的内核包,完美适配你当前的通用内核。
之后你就可以按照常规步骤配置WireGuard的隧道、接口了,完全不需要切换到实时内核。
另外,附上你之前执行命令时的输出供参考:
root@iotgateway:~# apt install wireguard --no-install-recommends
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
linux-image-6.1.0-13-rt-amd64 linux-image-rt-amd64
Suggested packages:
linux-doc-6.1 debian-kernel-handbook grub-pc | grub-efi-amd64 | extlinux
The following NEW packages will be installed:
linux-image-6.1.0-13-rt-amd64 linux-image-rt-amd64 wireguard
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
16 not fully installed or removed.
Need to get 0 B/68.7 MB of archives.
After this operation, 408 MB of additional disk space will be used.
Do you want to continue? [Y/n] ^C
备注:内容来源于stack exchange,提问作者TCB13

