2

I am running CentOS 7 and I just ran yum update.

Something in the resulting output makes me hesitate to type y to proceed with the update.

Here's what it says:

===============================================================================================================================
 Package                           Arch                   Version                               Repository                Size
===============================================================================================================================
Installing:
 kernel                            x86_64                 3.10.0-327.36.3.el7                   updates                   33 M
Updating:
 kernel-headers                    x86_64                 3.10.0-327.36.3.el7                   updates                  3.2 M
 kernel-tools                      x86_64                 3.10.0-327.36.3.el7                   updates                  2.4 M
 kernel-tools-libs                 x86_64                 3.10.0-327.36.3.el7                   updates                  2.3 M
Removing:
 kernel                            x86_64                 3.10.0-327.13.1.el7                   @updates                 136 M

Usually, if there's an update to the kernel, it comes up as an update. This "removing" and "installing" combination makes me nervous.

Before I proceed, is this sensible? Or is there something else I should do?

4 Answers4

4

Short version: it's fine, it's removing an old version and installing a new version.

Long version: It wants to remove version

3.10.0-327.13.1.el7

and install version

3.10.0-327.36.3.el7

Note that the one it wants to install appears to be many versions newer. I find package managers tends to delete an old version before installing a new version as that partition is small. They tend to keep a few versions between oldest and newest in case you need to roll back.

On Amazon Linux my understanding is you need to reboot to apply the new kernel, or at least that this is the easiest way.

Someone who knows more about this may correct me or provide a more full understanding.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • I'm just concerned because the other packages are being "Updated". Why isn't this one? I don't want to lose my kernel! – Lightness Races in Orbit Dec 10 '16 at 02:20
  • 1
    @LightnessRacesinOrbit A careful inspection of `uname -a` will reveal that the kernel being removed is not the running kernel, but a _previous_ kernel to it, and you will find that there are at least two (or more; usually three to five) possibly bootable kernels on your system at any given time. This problem was solved long ago. – Michael Hampton Dec 10 '16 at 04:08
  • To answer your question, kernels are not "upgraded", a new version is installed. Another way to phrase this is kernel version "3.10.0-327" is being upgraded, it's just that Linux gives you the full story. – Tim Dec 10 '16 at 06:41
  • So why is it not deemed "Upgrading" like the other packages? It's not that I don't believe you guys, but I need a bit more evidence than "it's okay trust me" before I go removing a package named "kernel"! – Lightness Races in Orbit Dec 10 '16 at 15:07
  • 1
    @LightnessRacesinOrbit The kernel is not upgraded for exactly the reason you are concerned about! What you are seeing is the system protecting itself from being unbootable. In the rare event something _did_ fail with the new kernel, grub simply falls through to the previous kernel, or the third kernel, or... Anyway, you seem to be asking for documents which date back to the 1990s, and those will be time consuming to find. This really is a long ago solved problem. – Michael Hampton Dec 10 '16 at 16:21
  • @Michael I was just asking for an answer supported by evidence and a detailed explanation, a Stack Exchange standard! Oh well. I went for it and everything works, so thanks – Lightness Races in Orbit Dec 10 '16 at 18:31
  • 1
    Unfortunately you got the answer from me, someone who knows enough to answer your question, but not enough to give you full history and background. You can try Wikipedia https://en.wikipedia.org/wiki/Linux_kernel or searching on Google, but a quick search didn't find much in this area – Tim Dec 10 '16 at 19:28
2

To add to the accepted answer: why new kernel packages are installed as new packages, rather than updates?

This is done on purpose to keep around older/previous kernel packages, installing the new one side-to-side to the older ones. In other words, while a simple package update would completely overwrite the installed version, treating a kernel update as a new install enable you to have different kernel versions concurrently installed (and available) on your system.

Every now and now a cleanup of older kernels happens, and you see the removed one in yum

shodanshok
  • 47,711
  • 7
  • 111
  • 180
1

For Kernel, it does not update or overwrite any existing files. It always installs a new version of the Kernel and it should keep last few Kernels only because of the partition size limit.

Since it does not overwrite any files/folders and it installs a new Kernel, you can still boot your server from the old Kernel if something goes wrong after booting your server from the new Kernel. This will allow to boot from previous Kernel. For the most Linux distribution, you will get an option to boot your server from specific installed Kernel during boot time.

0

You should usually accept kernel updates whenever they're available as they contain bugfixes and security patches.

Note that the Linux package manager (yum in your case) always keeps around a few older kernels (while deleting the very old ones), so if you ever notice strange behaviours with the new kernel (you shouldn't), you can always boot to an older kernel at the GRUB prompt, or even revert permanently to an older kernel.

dr_
  • 1,085
  • 12
  • 19