Is Linux-Headers recommended to be installed?

I use kernel 5.4.80 (LTS) on all my computers. I just had an update on one machine on kernel 5.4.80-1 to 5.4.80-2. So I updated the kernel with no problem. On my laptop same thing, except I also had an update on linux54-headers, which I also updated. Then I realized I don’t have linux54-headers installed on my desktop. I installed it just in case, but I’m wondering why wasn’t it installed when I had installed it through the Manjaro system settings? It’s not a bad idea to have it installed from the search I did online! So is linux-headers necessary to have or installed?

Not necessary as long as you don’t need them… :joy:
You may need them on some hardware to install drivers or module that are not built in the kernel…

It’s neither recommended or not… you may never need them or need them during install… all depends of your hardware and which software you install.

To have them will just use space (no process or ram) on your system and it’s not harmful if you actually not need them

1 Like

Afaik, kernel headers are needed when compiling a kernel. Do you?

If you want to know why you installed a package on your system (and forgot about it), you can check for clues:

  • the package details in Pamac (when it was installed, as well as the install reason, explicite or as a dependency for another package).
  • the “pacdep” package in the AUR repository to further track down a package dependencies. It can tell you specifically which other package it’s a dependency of (Pamac doesn’t).

These might help you decide whether to keep a package installed or remove it.

1 Like

Not true. Kernel headers are required when compiling any code that uses kernel functions and usually runs in kernel mode. An example of this is a chipset sensors module.

Some packages in the AUR require the kernel headers to be installed, but they are almost always downloaded as a dependency. There is no need for you to install them yourself unless you are a computer programmer creating kernel modules. If that were the case, you wouldn’t be asking this question.


Alright, withdrawned.

I would say they are needed for compiling most (any) code, because they will have to be linked to some library in your system.
So if you don’t compile any source files then you won’t be needing the headers…

Again, not true. They are ONLY required when compiling anything against the kernel, and MOST packages that require compilation DO NOT run in kernel mode.

Before anybody says otherwise, running as root DOES NOT imply running in kernel mode. The kernel mode interacts directly with system hardware.

I’m not sure if there is a misunderstanding here but…
“Linux-headers” in my pov. does not only include kernel headers, but also other header files like the stdlib etc…

it’s actually only kernel headers… then it’s only needed if you want build for the kernel space, like as drivers, modules, etc.

package description : Headers and scripts for building modules for the Linux kernel
the standard c libraries are in glibc (from gnu project… they were having all just missing the kernel when linus released linux kernel)