I'm running 14.04, installed onto an empty hard drive. The Linux header files are installed, but the .h files are empty. I can see the files here are all zero length: /usr/src/linux-headers-3.13.0-37-generic/include/config .

The header files are installed as per:

> sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-3.13.0-37-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

How can I really install the header files, such that they have a non-zero length?

  • What exactly are you expecting? If you want the full kernel source, it's in linux-source. – fkraiem Oct 14 '14 at 23:50
  • Two questions really. 1) Why are the files empty? 2) How can I get just the header files without installing linux-source? – Jeff Oct 15 '14 at 15:37
  • 1
    Did you try sudo apt-get install --reinstall linux-headers-$(uname -r)? – muru Oct 17 '14 at 0:16
  • Didn't work. I also looked at the file: /var/cache/apt/archives/linux-headers-3.13.0-37-generic_3.13.0-37.64_amd64.deb and did a manual unpack and the files were empty as a result. Manual unpack was with: dpkg-deb -x *.deb /tmp/extract/ – Jeff Oct 18 '14 at 4:18
  • @Jeff, you have given a bounty to lemonsqueeze for his answer, if that what you where looking for please accept his answer. see askubuntu.com/help/someone-answers – user.dz Nov 25 '15 at 14:43

Just came across this, according to Kristof:

include/config is not used for header files at all. It's part of a clever trick to optimize the kernel build.

The kernel configuration (stored in .config) is used to generate a header file which is used throughout the kernel. The problem is that changing one option means all files which include config.h will need to be rebuilt, even though most of them may not be affected by that option.

This is solved by removing the makefile dependency on config.h and replacing it by a dependency on one of the files in include/config. Each file there corresponds to a configuration option. Whenever that option is changed the configuration system touches that file (updating its timestamp causing make to rebuild all dependant files.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.