Ubuntu – What are the deb files for installing a kernel for

kernelUbuntu

When installing a kernel in Ubuntu(e.g. http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/), what are the files for respectively:

linux-headers-4.0.0-xxx_all.deb

linux-headers-4.0.0-xxx-generic_xxx_i386/amd64.deb
linux-image-4.0.0-xxx-generic_xxx_i386/amd64.deb

linux-headers-4.0.0-xxx-lowlatency_xxx_i386/amd64.deb
linux-image-4.0.0-xxx-lowlatency_xxx_i386/amd64.deb

Best Answer

Debian (and Ubuntu and other derivatives) divides Linux kernel packages into several parts:

  • linux-image-VERSION-PATCHLEVEL-FLAVOR contains the kernel image that is loaded by the bootloader, a file containing the symbol table (used by some system tools), a file containing the kernel configuration (informative for the system administrator), and modules that can be loaded dynamically. This is the package that is needed for normal use of the system.
  • linux-headers-VERSION-PATCHLEVEL-FLAVOR contains headers that are shipped with the kernel source or generated during the kernel compilation. These headers are needed to compile third-party kernel modules.
  • linux-libc-dev contains headers that are used to compile userspace programs. These headers are backwards compatible (unlike the headers used to compile kernel modules), so there is no need to install multiple versions.
  • linux-doc-VERSION contains kernel documentation. It is useful for people who write kernel modules or diagnose kernel-behavior.
  • linux-source-VERSION contains the kernel sources. People who want to compile their own kernel can install this binary package and unpack the archive that it contains.
  • linux-tools-VERSION contains tools that depend on the kernel version. Currently there is only perf.

The packaging distinguishes VERSION (the upstream version) from PATCHLEVEL (incremented on each change that affects binary compatibility). A bug fix can affect binary compatibility, so modules need to be recompiled, so it must be possible to install multiple patchlevels of kernels (and headers and third-party modules), so that you can have both the files for the running kernel and the files for the kernel that you'll next reboot to installed at the same time. There's a single package per version for the documentation and the source because there's no need to have multiple copies of them for different patchlevels.

The different FLAVORs correspond to kernel compilation options. Some kernel options are compromises, for example to support computers with large physical memory (at the expense of an overhead in kernel memory) or only computers with small physical memory (less overhead but a smaller maximum amount of RAM).

In current versions of Ubuntu, there are only two kernel flavors: “generic” (suitable for most computers) and “lowlatency” (which makes programs more reactive at the cost of a little more CPU overhead, see https://askubuntu.com/questions/126664/why-to-choose-low-latency-kernel-over-generic-or-realtime-ones). Debian has many more, most of which only make sense on specific architectures.

In addition to the packages with full version numbers, there are metapackages with no version as part of the package name. That way, you can install e.g. linux-image-generic which always depends on the latest linux-image-VERSION-PATCHLEVEL-generic package. For example, linux-image-generic version 3.13.0.42 depends on linux-image-3.13.0-42-generic, linux-image-generic version 3.13.0.43 depends on linux-image-3.13.0-43-generic, etc. As the linux-image-generic package gets upgraded, newer kernel packages are pulled in.

Related Question