sudo apt-get install linux-headers-$(uname -r)
返回:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-headers-4.10.0-42-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-4.10.0-42-generic' has no installation candidate
我怀疑这可能是导致新 nvidia 驱动程序安装失败的问题。
有什么想法如何解决吗?
一些可能有用的信息:
uname -r
4.10.0-42-generic
dpkg-查询-s linux-headers-$(uname -r)
dpkg-query: package 'linux-headers-4.10.0-42-generic' is not installed and no information is available
sudo apt 列表--已安装|grep 标题
libxmu-headers/artful,artful,now 2:1.1.2-2 all [installed,automatic]
linux-headers-4.13.0-41/artful-updates,artful-updates,artful-security,artful-security,now 4.13.0-41.46 all [installed,automatic]
linux-headers-4.13.0-41-generic/artful-updates,artful-security,now 4.13.0-41.46 amd64 [installed,automatic]
linux-headers-4.13.0-43/artful-updates,artful-updates,artful-security,artful-security,now 4.13.0-43.48 all [installed,automatic]
linux-headers-4.13.0-43-generic/artful-updates,artful-security,now 4.13.0-43.48 amd64 [installed,automatic]
linux-headers-generic/artful-updates,artful-security,now 4.13.0.43.46 amd64 [installed]
答案1
Error: Could not find linux-headers- ubuntu 18.04 virtual machine
在阅读了许多解决此错误的方法后,我发出了以下命令:sudo apt-get install linux-headers-server
uname -r
sudo apt-get list | grep headers
sudo apt-get install linux-headers-generic
该命令给了我已安装的通用命令、已安装的权限uname
和已安装的权限linux-headers
。太棒了!