How to solve: Oracle Linux UEK kernel update does not trigger needed reboot when performing needs-restarting -r

Gahan says: Problem solved

My Oracle Linux 8.7 machine said this in an email after an automatic update cycle:

The following updates have been applied on 'oralinux1':
 Package           Arch    Version                     Repository          Size
 kernel-uek        x86_64  5.4.17-2136.319.1.2.el8uek  ol8_UEKR6          112 M
 kernel-uek-devel  x86_64  5.4.17-2136.319.1.2.el8uek  ol8_UEKR6           19 M
 kernel-uek        x86_64  5.4.17-2136.317.5.5.el8uek  @ol8_UEKR6         136 M
 kernel-uek-devel  x86_64  5.4.17-2136.317.5.5.el8uek  @ol8_UEKR6          75 M

Transaction Summary
Install  2 Packages
Remove   2 Packages

Updates completed at Thu 18 May 2023 06:55:10 AM GMT

So, you would definately need a restart, right?

[sudo] password for opc: 
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.
[opc@oralinux1 ~]$

So, what is the present running kernel?

[opc@oralinux1 ~]$ uname -r

Okay, compared to the email we should have a newer kernel, checking it again on the command line:

[opc@oralinux1 ~]$ sudo grubby --default-kernel

So this says: If you reboot, this newer kernel will be used at boot. And yes there is a newer kernel.

But why doesn’t needs-restarting say something about it? Probably, according to my Google searches, this is intended functionality and not a bug. But you can change functionality to make it work for UEK kernels. See this thread:

As this didn’t work right away, I needed to make some minor adjustments to make it work:

sudo su - 
mkdir -p /etc/dnf/plugins/needs-restarting.d/ && cd $_
touch uek.conf
echo "kernel-uek" > /etc/dnf/plugins/needs-restarting.d/uek.conf
cat uek.conf

No need to restart anything after this change, just run needs-restarting again:

[opc@oralinux1 ~]$ sudo needs-restarting -r
Core libraries or services have been updated:
  * kernel-uek

Reboot is required to ensure that your system benefits from these updates.

More information:
[opc@oralinux1 ~]$

Now you can reboot your machine to boot with the newer kernel.

Gerelateerd bericht

Geef een reactie

%d bloggers liken dit: