Linux-Headers 与安装的内核版本不同

Linux-Headers for Different Kernel Version than installed

如何获得与系统上安装的内核版本不同的 Linux-Headers?(Debian) 我搜索了整个 Web,除了可以下载 Headers 对于您当前的 运行 内核,为什么非 运行 内核很难获得 Headers?

我需要 4.16 headers 来编译 LKM,但我 运行 在 4.9 上。

您可以从以下位置获取任何标准版本的内核头文件和源代码:

git clone https://github.com/torvalds/linux

或来自:https://cdn.kernel.org/pub/linux/kernel/v4.x/

如果从 git 仓库中提取,您将需要检查您希望构建的特定版本。你的情况:

git checkout v4.16