无法安装 Debian Stretch 内核头文件

coo*_*594 7 debian linux-kernel

我在 VPS 和专用服务器上运行 Debian 9 Stretch。我已将两者都更新到 backports 存储库上的最新内核apt install linux-image-4.18.0-0.bpo.1-amd64

问题是当我使用apt install linux-headers-4.18.0-0.bpo.1-amd64以下方法安装标头时,出现以下错误。

The following packages have unmet dependencies:
 linux-headers-4.18.0-0.bpo.1-amd64 : Depends: linux-compiler-gcc-6-x86 (>= 4.14.17-1~) but 4.9.110-3+deb9u6 is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题,为什么在不同的服务器上这对我来说是个问题?

Ste*_*itt 10

您需要告诉apt使用 backports 来满足标头的依赖关系:

apt install -t stretch-backports linux-headers-4.18.0-0.bpo.1-amd64
Run Code Online (Sandbox Code Playgroud)

我强烈建议安装默认的内核和头文件包:

apt install -t stretch-backports linux-image-amd64 linux-headers-amd64
Run Code Online (Sandbox Code Playgroud)

这将确保您在可用时获得更新的内核和头文件,即使它们的 ABI(以及它们的包名称)发生变化。