5

Just spin up an EC2 instance with Ubuntu, if it is a new fresh instance, isn't supposed the Kernel to be up to date?

After I run a sudo apt update && sudo apt install <any-package>, I receive the message below:

Package configuration

  ┌───────────────────────┤ Pending kernel upgrade ├───────────────────────┐
  │                                                                        │ 
  │ Newer kernel available                                                 │ 
  │                                                                        │ 
  │ The currently running kernel version is 5.15.0-1031-aws which is not   │ 
  │ the expected kernel version 5.19.0-1022-aws.                           │ 
  │                                                                        │ 
  │ Restarting the system to load the new kernel will not be handled       │ 
  │ automatically, so you should consider rebooting.                       │ 
  │                                                                        │ 
  │                                 <Ok>                                   │ 
  │                                                                        │ 
  └────────────────────────────────────────────────────────────────────────┘ 
                                                                             

Is this normal? If not, how can I avoid it?

1
  • Had same issue spinning up from an Ubuntu AMI on EC2.
    – dmanexe
    Apr 11, 2023 at 16:52

1 Answer 1

4

Please read the message. It explains things perfectly.

The headline is Pending kernel upgrade, which informs you that there's a newer kernel pending.

The last line informs you what do to apply this change:

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting.

And no, you are not guaranteed that images are perfectly up to date at all times. You should perform required upgrades after deploying.

6
  • 1
    I got this message, read it and figured "I probably just need to restart after a fresh install". So I did. However, now I am getting it again after doing an apt update. Is that normal? I think the question here isn't what the message says so much as what it really imposes. How often will my kernel become pending an upgrade and require restarting? Oct 23, 2023 at 21:44
  • @AlexiTheodore kernel updates is normal. You don't have to reboot, but you won't get the benefits of you don't. Canonical offers a live patch service if you can't reboot.
    – vidarlo
    Oct 23, 2023 at 22:41
  • Perfectly? What is the expected version? Expected by whom? I expect the current version to be expected. Is the newer kernel already installed? Who did this? The only thing that is clear is that after reboot the new kernel will be running. If that's the only thing they we're trying to convey, the message is awfully long, it should read: "reboot to get the new kernel." Consider making your answer useful by explaining how this live patching works. Right now your answer looks to me like a long way to say "reboot to get the new kernel." Which as you say is perfectly explained by the orig message.
    – x-yuri
    Apr 4 at 1:16
  • @x-yuri Live patching was not asked about. Obviously the original asker found the answer useful.
    – vidarlo
    Apr 4 at 6:14
  • Okay, maybe your answer is useful. In the sense that it calms people down, "It's okay, fear not, reboot when you have time to get the new kernel." But it doesn't explain what happened. I simply suggest to make your answer better. But it's up to you. Live patching was not asked about, but if a person knew how live patching works they wouldn't ask about it.
    – x-yuri
    Apr 4 at 21:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .