由于未满足依赖关系,无法安装 linux-headers

由于未满足依赖关系,无法安装 linux-headers

安装 debian 后,我立即将存储库更改为测试:

$ cat /etc/apt/sources.list
# Debian packages for testing
deb http://ftp.by.debian.org/debian/ testing main non-free contrib
# Uncomment the deb-src line if you want 'apt-get source'
# to work with most packages.
deb-src http://ftp.by.debian.org/debian/ testing main non-free contrib

# Security updates for stable
# deb http://security.debian.org/ stable/updates main contrib

我想安装 linux 标头,因为安装需要它们英伟达驱动程序

显然,当我切换到测试时,我的内核保持相同的版本,因为没有安装 linux-headers(我假设)。它是 4.9.0-3-amd64,但现在是 4.11.0-1-amd64。在检查了可用内容后,我安装了 4.11.0-1-amd64:

~$ apt-cache search linux-image
linux-headers-4.11.0-1-amd64 - Header files for Linux 4.11.0-1-amd64
linux-headers-4.11.0-1-rt-amd64 - Header files for Linux 4.11.0-1-rt-amd64
linux-image-4.11.0-1-amd64 - Linux 4.11 for 64-bit PCs
linux-image-4.11.0-1-amd64-dbg - Debug symbols for linux-image-4.11.0-1-amd64
linux-image-4.11.0-1-rt-amd64 - Linux 4.11 for 64-bit PCs, PREEMPT_RT
linux-image-4.11.0-1-rt-amd64-dbg - Debug symbols for linux-image-4.11.0-1-rt-amd64
linux-image-4.9.0-3-amd64 - Linux 4.9 for 64-bit PCs
linux-image-4.9.0-3-rt-amd64 - Linux 4.9 for 64-bit PCs, PREEMPT_RT
linux-image-amd64 - Linux for 64-bit PCs (meta-package)
linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package), PREEMPT_RT

现在我想通过运行来安装标头:

~$ sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-headers-amd64 : Depends: linux-headers-4.9.0-3-amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.

它抱怨我有未满足的依赖关系。我如何安装元标头包?

PS:当我检查时linux-headers-amd64它说这取决于 linux-headers-4.9.0-3-amd64。但是当我有旧的内核时(linux-image-4.9.0-3-amd64)它还抱怨同样未满足的依赖关系!

答案1

我遇到了同样的问题,我正在运行4.9.0-3,最近的更新破坏了我的 X 服务器(我被删除到文本控制台)。

我发现nVidia模块没有加载,所以我尝试重新编译它。就在那时我注意到内核头文件丢失了。

linux-image-4.11.0-1-all我的解决方案是与适当的标头一起安装。重新启动进入新内核后,我重新编译了 nVidia 内核模块。目前我安装了以下软件包:

linux-headers-4.11.0-1-all
linux-headers-4.11.0-1-all-amd64
linux-headers-4.11.0-1-amd64
linux-headers-4.11.0-1-common
linux-headers-4.11.0-1-common-rt
linux-headers-4.11.0-1-rt-amd64

这就是解决问题的方法。我在此处的包存储库中看到一个错误,因为linux-headers-amd64除了不安装之外,安装不会提供任何冲突解决方案。我自己正在等待修复该问题的更新,特别是因为 ZFS 内核模块也无法安装。

答案2

显然这些软件包需要由 Debian 软件包维护者自己升级。现在,https://packages.debian.org/buster/linux-headers-amd64具有正确的依赖关系。

相关内容