如何解决“/lib/modules/3.13.0-27-generic/build: No such file or directory”错误信息?

Muh*_*ana 8 compiling kernel bug-reporting make

我正在按照此页面上的说明进行操作,因此我可以向此错误报告模块提交有关我的机器的足够信息。

我被困在运行以下一些命令

git clone git://github.com/Lekensteyn/acpi-stuff.git
cd acpi-stuff/acpi_dump_info
make
sudo make load
cat /proc/acpi/dump_info > handles.txt
Run Code Online (Sandbox Code Playgroud)

我克隆了 Git 存储库,但无法运行make命令,我收到以下错误消息:

mg@MG-7520SE:~/workspace/HybridGraphicsCards$ cd acpi-stuff/acpi_dump_info
mg@MG-7520SE:~/workspace/HybridGraphicsCards/acpi-stuff/acpi_dump_info$ make
make -C /lib/modules/3.13.0-27-generic/build M=/home/mg/workspace/HybridGraphicsCards/acpi-stuff/acpi_dump_info modules
make[1]: *** /lib/modules/3.13.0-27-generic/build: No such file or directory.  Stop.
Makefile:9: recipe for target 'default' failed
make: *** [default] Error 2
mg@MG-7520SE:~/workspace/HybridGraphicsCards/acpi-stuff/acpi_dump_info$ sudo make
[sudo] password for mg: 
make -C /lib/modules/3.13.0-27-generic/build M=/home/mg/workspace/HybridGraphicsCards/acpi-stuff/acpi_dump_info modules
make[1]: *** /lib/modules/3.13.0-27-generic/build: No such file or directory.  Stop.
Makefile:9: recipe for target 'default' failed
make: *** [default] Error 2
Run Code Online (Sandbox Code Playgroud)

所以克隆Git仓库后,我访问指定的目录acpi-stuff/acpi_dump_info并运行make但它没有工作。我尝试运行它,因为sudo它仍然不起作用。

我注意到它在抱怨,因为build目录下没有/lib/modules/3.13.0-27-generic/目录。我不确定这到底是什么,但从它的外观来看,该make命令需要我的内核的编译版本,但没有找到。但无论如何我对此一无所知。

我尝试通过运行命令来安装 linux 头文件

  1. sudo apt-get install linux-headers-3.13.0-27-generic
  2. sudo apt-get install linux-headers-uname -r`

..但他们都失败了并且有相同的输出

mg@MG-7520SE:~$ sudo apt-get install linux-headers-3.13.0-27-generic
[sudo] password for mg: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-3.13.0-27-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-3.13.0-27-generic' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

我的系统信息:

mg@MG-7520SE:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.10
Release:    14.10
Codename:   utopic
mg@MG-7520SE:~$ uname -a
Linux MG-7520SE 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

那么我应该怎么做才能make在这个目录下成功运行命令呢?

sol*_*iCe 9

你需要安装linux-headers-3.13.0-27-generic

sudo apt-get install linux-headers-3.13.0-27-generic
Run Code Online (Sandbox Code Playgroud)

或更好

sudo apt-get install linux-headers-`uname -r`
Run Code Online (Sandbox Code Playgroud)

这将提供链接 /lib/modules/3.13.0-27-generic/build


Muh*_*ana 4

我使用的内核(v3.13)不适合与我正在使用的发行版(Ubuntu 14.10)一起使用。

因此,我通过运行以下命令为我的发行版安装了最新的内核:

sudo apt-get install linux-generic
Run Code Online (Sandbox Code Playgroud)

它也解决了我的亮度问题!

  • 有人可以解释为什么这个答案被否决吗? (3认同)