sudo apt-get install linux-headers-$(uname -r)
Returns:
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
I suspect that this might be the problem behind the failed installation of new nvidia drivers.
Any ideas how to solve?
Some maybe helpful info:
uname -r
4.10.0-42-generic
dpkg-query -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 list --installed | grep headers
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]
I issued these commands after reading many approach to this error after :
sudo apt-get install linux-headers-server
uname -r
sudo apt-get list | grep headers
sudo apt-get install linux-headers-generic
The command gave me generic that was installed, the
uname
and the rightlinux-headers
was installed. Gurls it works!