Hi, I can’t find a quick answer to this simple question, so I ask the question here.
When I update the kernel as part of a general system update, using #dnf upgrade, does the new kernel automatically become the running kernel, or is a reboot required to get the new kernel up and running?
When a new kernel is installed during a dnf update, a reboot is required for the new kernel to become active.
As an addendum, a few quick ways you can check things yourself!
Here’s how you get a list of all packages with “kernel” in their name present on your system:
rpm -qa | grep kernel
The system by default keeps 3 kernel versions installed, in case of a bad upgrade, faulty driver, or similar. You can choose between them on every reboot from the GRUB bootloader menu.
You can check the kernel version you are running (on any Linux system) with this command:
I encourage you to read about these command line programs and more - you can do an awful lot to get info about and customize your machine.
As an addendum to the addendum , you can change the kernel without fully rebooting.
kexec, you can switch kernels without rebooting the hardware. However, systemd and all services will still need to be restarted. But it can be handy when dealing with a system that’s on it’s last legs, that you aren’t confident will boot again.
Not all hardware plays well with this. I’ve used it a few times successfully on servers, but on desktops it can be fickle (wireless card drivers in the new kernel won’t like the old firmware loaded in the card, fails to load new firmware, etc).
Anyway, it’s a neat trick to learn and fun to play with.
One more thing …
The kernel is not the only package that does not get its new version into use with mere ‘dnf up’.
Red Hat describes what, why, and how to check in: Identify packages that will require a system reboot after an update - Red Hat Customer Portal
Thanks all for your tips, and especially thanks a lot for this link @jlehtone:
Very useful! I will use
# needs-restarting -r
after each update. This will list any services that require a reboot.
Example from my server after the latest update+reboot:
[root@server ~]# needs-restarting -r
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.