我想在 Ubuntu 20.04 上安装适用于 Kernel Linux 5.18.8 的 Linux-headers,但是当我运行命令时sudo apt-get install linux-headers-$(uname -r)
出现错误:
Building dependency tree
Reading state information... Done
Package linux-headers-5.18.8-051808-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'linux-headers-5.18.8-051808-generic' has no installation candidate
我该如何修复这个错误?
答案1
您安装了一些不是来自 Ubuntu 存储库的内核。
Ubuntu 存储库仅包含受支持内核的标头。您无法使用
sudo apt-get install linux-headers-$(uname -r)
对于您手动安装的任何内核。
您需要从获取图像的位置下载或构建与已安装内核相对应的标题。