使用pkg1.run安装Nvidia驱动程序以“no Version.h found”结尾

我已经阅读了很多并尝试了很多 – 没有什么对我有用。

我有戴尔Inspiron 8200(1600×1200)和Geforce MX440 Mobile。 安装驱动程序的“简单方法”( sudo apt-get install nvidia-current )让我陷入了一个微小的不可更改的分辨率(1024×768或800×600)。 所以我走的很艰难:

  • sudo apt-get update
  • sudo apt-get dist-upgrade
  • 将nouveau-driver列入黑名单
  • 重新启动
  • 下载并运行( sudo sh ... )Nvidia 96文件结束pkg1.run ,这对我来说是正确的,因为我读到了某处。

这导致错误:

 ERROR: The kernel header file '/lib/modules/3.08.0-35-generic/build/include/linux/version.h' does not exist. The most likely reason for this is that the kernel source files in '/lib/modules/3.08.0-35-generic/build' have not been configured. 

如何配置内核源文件? 没有什么比sudo make-preparesudo get-apt kernel-devel合适吗?

建议复制version.hcp -v /usr/include/linux/version.h /lib/modules/$(uname -r)/build/include/linux )导致此错误:

 ERROR: If you are using a Linux 2.4 kernel, please make sure you either have configured kernel sources matching your kernel or the correct set of kernel headers installed on your system. If you are using a Linux 2.6 kernel, please make sure you have configured kernel sources matching your kernel installed on your system. If you specified a separate output directory using either the "KBUILD_OUTPUT" or the "O" KBUILD parameter, make sure to specify this directory with the SYSOUT environment variable or with the equivalent nvidia-installer command line option. Depending on where and how the kernel sources (or the kernel headers) were installed, you may need to specify their location with the SYSSRC environment variable or the equivalent nvidia-installer command line option. 

内核源安装在哪里?

我甚至尝试使用--kernel-source-path /usr/include/linux (其中version.h和许多其他.h文件)运行...pkg1.run作为参数,但这会导致:

  ERROR: The kernel header file '/usr/include/linux/include/linux/kernel.h' does not exist (...) 

有人有想法吗?

好吧,看起来你的安装过程太多了…请在做任何事之前先阅读所有内容。

你唯一需要做的就是安装内核头文件,一切都会好的:

 sudo apt-get install linux-generic 

这是你必须做的唯一的事情,并将解决“内核头文件’version.h’不存在。” 错误……现在我们需要恢复您所做的工作以使其正确。

如何配置内核源文件? 没有什么比sudo make-prepare或sudo get-apt kernel-devel更合适吗?

您不需要配置任何东西。 如果你使用APT,一切都会放好。 此外,你不需要sudomake 。 没有get-apt也没有make-prepare命令,所以无论你在哪里看到那些只是关闭那个页面并且不相信任何在那里说的东西。

建议复制version.h(cp -v /usr/include/linux/version.h / lib / modules / $(uname -r)/ build / include / linux)导致此错误:

你必须只遵循过去1年的指南和知道他们正在做什么的人… /usr/include/linux/version.h文件和/lib/modules/$(uname -r)/build/include/linux主要由不同的包提供。 usr那个由linux-libc-dev提供,而你需要的那个是由linux-headers提供的。 去掉它:

 sudo rm /lib/modules/$(uname -r)/build/include/linux/version.h 

错误:内核头文件’/usr/include/linux/include/linux/kernel.h’不存在(…)

安装headers包时也会修复此问题。