11

I'm following the instructions on this page so I can submit enough information about my machine to this bug report module.

I'm stuck in running some of the following commands

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

I cloned the Git repository but I can't run the make command, I'm getting the following error messages:

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

So after cloning the Git repository, I access the specified directory acpi-stuff/acpi_dump_info and ran make but it didn't work. I tried running it as sudo it still didn't work.

I noticed its complaining because there is not build directory under the /lib/modules/3.13.0-27-generic/ directory. I'm not sure what this is exactly but from the looks of it, the make command needed a compiled version of my kernel but didn't find one. But I know nothing about that anyway.

I tried installing linux headers by running the commands

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

..but they both failed and had the same output

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

My system infomration:

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

So what should I do to be able to run the make command successfully under this directory ?

4 Answers 4

14

you need to install linux-headers-3.13.0-27-generic package

sudo apt-get install linux-headers-3.13.0-27-generic

or better

sudo apt-get install linux-headers-`uname -r`

this will provide the link /lib/modules/3.13.0-27-generic/build

4
  • It didn't work. Check my question for the output of running these commands. Nov 29, 2014 at 16:18
  • what are you running ? ubuntu ? debian ? mint ? try running sudo apt-get update && apt-get dist-upgrade before
    – solsTiCe
    Nov 29, 2014 at 16:30
  • (Ubuntu 14.10) 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, lsb_release -a: No LSB modules are available, Distributor ID: Ubuntu, Description: Ubuntu 14.10, Release: 14.10, Codename: utopic Nov 29, 2014 at 16:31
  • 1
    uname -r or $(uname -r) doesn't work. The header I need is 4.4.0-154-generic but the command results in 4.4.154. Moreover, I had to edit Makefile because it also (ab)uses uname Jun 3, 2020 at 13:37
4

I was using a kernel (v3.13) that is not meant to be used with the distro version I'm using (Ubuntu 14.10).

So I installed the latest possible kernel for my distro by running the following command:

sudo apt-get install linux-generic

It fixed my brightness issue too !

1
  • 3
    Can someone please explain why this answer is downvoted?
    – jzonthemtn
    Dec 14, 2015 at 19:20
2

Find where your build-essentials are kept

find / | grep include/generated/autoconf.h

Mine returned

/usr/src/linux-headers-4.19.0-5-amd64/include/generated/autoconf.h

If you followed the guides online and they didn't work, replace

/lib/modules/`uname -r`/build

With the result from above - in my case

/usr/src/linux-headers-`uname -r`

So, in total

obj-m += hello-1.o

all:
    make -C /usr/src/linux-headers-$(shell uname -r) M=$(PWD) modules

clean:
    make -C /usr/src/linux-headers-$(shell uname -r) M=$(PWD) clean
1

had the same problem with using an old kernel. You need to install -generic headers, for that head to this site: https://kernel.ubuntu.com/~kernel-ppa/mainline/ And download the Kernel headers for your kernel with wget url. Next run sudo dpkg -i pakage-name.deb. Then try to build. If it doesn't work and you get the *** /lib/modules/3.13.0-27-generic/build: No such file or directory. Error message, head over to /lib/modules and check if your headers are named differently. If so, just change the name of them to mach the one looked for by the make program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .