我安装的 Debian 的内核头包版本错误

我安装的 Debian 的内核头包版本错误

我试图在 Debian 11 上安装 ZFS,先决条件是安装正确的内核头文件。我尝试安装的每个软件包都不起作用。我的内核是5.10.0-18-amd64,但这些都尝试使用5.10.0-19-amd64。这是在全新的 Linode Debian 安装上。

“linux-headers-amd64”和“linux-headers-generic”

OpenZFS 教程建议安装“linux-headers-generic”和Debian 维基推荐“linux-headers-amd64”,但似乎都没有按预期工作。当我尝试从标题中的包安装内核头文件时,它们似乎处于错误的版本上。标头本身安装得很好,但是当我安装 zfsutils-linux 时

Module build for kernel 5.10.0-18-amd64 was skipped since the
kernel headers for this kernel does not seem to be installed.

尽管如此,zfsutils-linux 安装得很好。但安装后,当我检查以验证 ZFS 是否正常工作时,我看到

root@localhost:~# modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/5.10.0-18-amd64

greping dpkg,标题显示 5.10.0-19

root@localhost:~# dpkg -l | grep "linux-header"
ii  linux-headers-5.10.0-19-amd64  5.10.149-2                     amd64        Header files for Linux 5.10.0-19-amd64
ii  linux-headers-5.10.0-19-common 5.10.149-2                     all          Common header files for Linux 5.10.0-19
ii  linux-headers-amd64            5.10.149-2                     amd64        Header files for Linux amd64 configuration (meta-package)

linux-headers-$(uname -r)

好的,让我们明确尝试使用“linux-headers-$(uname -r)”安装正确的版本。我不想这样做,因为(如果我错了,请纠正我),与其他两个元包相比,更新起来很痛苦。无论如何,这就是它所说的

Preconfiguring packages ...
Selecting previously unselected package dctrl-tools.
(Reading database ... 61322 files and directories currently installed.)
Preparing to unpack .../00-dctrl-tools_2.24-3+b1_amd64.deb ...
Unpacking dctrl-tools (2.24-3+b1) ...
Selecting previously unselected package dkms.
Preparing to unpack .../01-dkms_2.8.4-3_all.deb ...
Unpacking dkms (2.8.4-3) ...
Selecting previously unselected package zfs-dkms.
Preparing to unpack .../02-zfs-dkms_2.1.5-1~bpo11+1_all.deb ...
Unpacking zfs-dkms (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libnvpair3linux.
Preparing to unpack .../03-libnvpair3linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libnvpair3linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libuutil3linux.
Preparing to unpack .../04-libuutil3linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libuutil3linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libzfs4linux.
Preparing to unpack .../05-libzfs4linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libzfs4linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libzpool5linux.
Preparing to unpack .../06-libzpool5linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libzpool5linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package zfsutils-linux.
Preparing to unpack .../07-zfsutils-linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking zfsutils-linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package zfs-zed.
Preparing to unpack .../08-zfs-zed_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking zfs-zed (2.1.5-1~bpo11+1) ...
Selecting previously unselected package linux-headers-5.10.0-19-common.
Preparing to unpack .../09-linux-headers-5.10.0-19-common_5.10.149-2_all.deb ...
Unpacking linux-headers-5.10.0-19-common (5.10.149-2) ...
Selecting previously unselected package linux-headers-5.10.0-19-amd64.
Preparing to unpack .../10-linux-headers-5.10.0-19-amd64_5.10.149-2_amd64.deb ...
Unpacking linux-headers-5.10.0-19-amd64 (5.10.149-2) ...
Selecting previously unselected package linux-headers-amd64.
Preparing to unpack .../11-linux-headers-amd64_5.10.149-2_amd64.deb ...
Unpacking linux-headers-amd64 (5.10.149-2) ...
Setting up libnvpair3linux (2.1.5-1~bpo11+1) ...
Setting up linux-headers-5.10.0-19-common (5.10.149-2) ...
Setting up libuutil3linux (2.1.5-1~bpo11+1) ...
Setting up dctrl-tools (2.24-3+b1) ...
Setting up linux-headers-5.10.0-19-amd64 (5.10.149-2) ...
Setting up linux-headers-amd64 (5.10.149-2) ...
Setting up libzfs4linux (2.1.5-1~bpo11+1) ...
Setting up dkms (2.8.4-3) ...
Setting up zfs-dkms (2.1.5-1~bpo11+1) ...
Loading new zfs-2.1.5 DKMS files...

它一直在这里明确提到补丁 19,这很奇怪,但过了一会儿它说

Building for 5.10.0-18-amd64 5.10.0-19-amd64
Building initial module for 5.10.0-18-amd64
Done.

看起来它是为补丁 18 构建的,所以一切都很好,对吧?但是之后...

depmod.....

DKMS: install completed.
Building initial module for 5.10.0-19-amd64

是的,当我明确告诉它安装补丁 18 时,它仍然会先于我所拥有的内核补丁进行构建。而且我已经在“为 5.10.0-19-amd64 构建初始模块”上停留了几个小时,不确定该怎么办。

该软件包是否只是没有正确提取我的内核数据并且附带了错误的版本?或者我做错了什么?补丁 19 内核头对我来说应该没用,因为我使用的是补丁 18,对吗?或者也许我可以将头文件移到某个地方?我已经检查过,我正在安装的 ZFS 版本应该支持我的内核版本。

答案1

弄清楚了,这是一个安装了 5.10.0-19-amd64 的更新,所以我需要重新启动。

相关内容