== How Ubuntu and Fedora each do kernel packages I feel the need to say things about the Ubuntu (and I believe Debian) kernel update process, but before I do that I want to write down how kernel packages look on Ubuntu and Fedora from a sysadmin's perspective because I think a number of people have only been exposed to one or the other. The Fedora approach to kernel packages is also used by Red Hat Enterprise Linux (and CentOS) and probably other Linux distributions that use _yum_ and RPMs. I believe that the Ubuntu approach is also used by Debian, but maybe Debian does it a bit differently; I haven't run a real Debian system. Both debs and RPMs have the core concepts of a package having a name, an upstream version number, and a distribution release number. For instance, Firefox on my Fedora 21 machine is currently _firefox_, upstream version _37.0_, and release _2.fc21_ (increasingly people embed the distribution version in the release number for reasons beyond the scope of this entry). On Fedora you have some number of _kernel-..._ RPMs installed at once. These are generally all instance of the _kernel_ package (the package name); they differ only in their upstream version number and their release number. Yum normally keeps the most recent five of them for you, deleting the oldest when you add a new one via a '_yum upgrade_' when a new version of the _kernel_ package is available. This gives you a list of main kernel packages that looks like this: .pn prewrap on > kernel-3.18.8-201.fc21.x86_64 > kernel-3.18.9-200.fc21.x86_64 > kernel-3.19.1-201.fc21.x86_64 > kernel-3.19.2-201.fc21.x86_64 > kernel-3.19.3-200.fc21.x86_64 Here the _kernel_ RPM with upstream version _3.19.3_ and Fedora release version _200.fc21_ is the most recent kernel I have installed (and this is a 64-bit machine as shown by the ``x86_64'' architecture). (This is a slight simplification. On Fedora 21, the kernel is actually split into three kernel packages: _kernel_, _kernel-core_, and _kernel-modules_. The _kernel_ package for a specific version is just a meta-package that depends (through a bit of magic) on its associated _kernel-core_ and _kernel-modules_ packages. Yum knows how to manage all of this so you keep five copies not only of the _kernel_ meta-package but also of the _kernel-core_ and _kernel-modules_ packages and so on. Mostly you can ignore the sub-packages in Fedora; I often forget about them. In RHEL up through RHEL 7, they don't exist and their contents are just part of the _kernel_ package; the same was true of older Fedora versions.) Ubuntu is more complicated. There is a single _linux-image-generic_ (meta-)package installed on your system and then some number of packages with the *package name* of _linux-image---generic_ for various and values. Each of these packages has a deb upstream version of and a release version of ., where the number varies depending on how Ubuntu built things. Each specific _linux-image-generic_ package version depends on a particular _linux-image---generic_ package, so when you update to it it pulls in that specific kernel (at whatever the latest package release of it is). Because of all of this, Ubuntu systems wind up with multiple kernels installed at once by the side effects of updating _linux-image-generic_. A new package version of l-i-g will depend on and pull in an entirely new _linux-image---generic_ package, leaving the old linux-image-*-generic packages just sitting there. Unlike with _yum_, nothing in plain _apt-get_ limits how many old kernels you have sitting around; if you leave your server alone, you'll wind up with copies of all kernel packages you've ever used. As far as the Ubuntu package system sees it, these are not multiple versions of the same thing but entirely separate packages, each of which you have only one version of. This gives you a list of packages that looks like this (splitting apart the package name and the version plus Ubuntu release, what '_dpkg -l_' calls _Name_ and _Version_): > linux-image-3.13.0-24-generic 3.13.0-24.47 > linux-image-3.13.0-45-generic 3.13.0-45.74 > linux-image-3.13.0-46-generic 3.13.0-46.79 > linux-image-3.13.0-48-generic 3.13.0-48.80 > > linux-image-generic 3.13.0.48.55 (I'm simplifying again; on Ubuntu 14.04 there are also _linux-image-extra---generic_ packages.) On this system, the current 3.13.0.48.55 version of linux-image-generic depends on and thus requires the linux-image-3.13.0-48-generic package, which is currently 'at' the nominal upstream version _3.13.0_ and Ubuntu release _48.80_. Past Ubuntu versions of linux-image-generic depended on the other linux-image-*-generic packages and caused them to be installed at the time. I find the Fedora/RHEL approach to be much more straightforward than the Ubuntu approach. With Fedora, you just have N versions of the kernel package installed at once; done. With Ubuntu, you don't really have multiple versions of any given package installed; you just have a lot of confusingly named packages, each of which has one version installed, and these packages get installed on your system as a side effect of upgrading another package (linux-image-generic). As far as I know the Ubuntu package system doesn't know that all of these different named packages are variants of the same thing. (A discussion of [[some unfortunate consequences of this Ubuntu decision UbuntuKernelManagement]] is beyond the scope of this entry. [[See also UbuntuHoldingKernels]].) === Sidebar: kernel variants Both Ubuntu and Fedora have some variants of the kernel; for instance, Fedora has a PAE variant of their 32-bit x86 kernel. On Fedora, these get a different package name, _kernel-pae_, and everything else works in the same way as for normal kernels (and you have both PAE and regular kernels installed at the same time; _yum_ will keep the most recent five of each). On Ubuntu I believe these get a different meta-package that replaces _linux-image-generic_, for example _linux-image-lowlatency_, and versions of this package depend on specific kernel packages with different names, like linux-image---lowlatency. You can see the collection with '_apt-cache search linux-image_'. Both Fedora and Ubuntu have changed how they handled kernel variants over time; my memory is that Ubuntu had to change more in order to become more sane. Today their handling of variants strikes me as reasonably close to each other.