Fail to upgrade kernel in RHEL8 (dracut module 'network-legacy' can t be found)

Latest response

Hi,

I am getting this error when upgrading my rhel8

Downloading Packages:
(1/3): kernel-4.18.0-348.12.2.el8_5.x86_64.rpm                                                                         20 MB/s | 7.0 MB     00:00
(2/3): kernel-modules-4.18.0-348.12.2.el8_5.x86_64.rpm                                                                 34 MB/s |  30 MB     00:00
(3/3): kernel-core-4.18.0-348.12.2.el8_5.x86_64.rpm                                                                    30 MB/s |  38 MB     00:01
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                  58 MB/s |  74 MB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                              1/1
  Installing       : kernel-core-4.18.0-348.12.2.el8_5.x86_64                                                                                     1/3
  Running scriptlet: kernel-core-4.18.0-348.12.2.el8_5.x86_64                                                                                     1/3
  Installing       : kernel-modules-4.18.0-348.12.2.el8_5.x86_64                                                                                  2/3
  Running scriptlet: kernel-modules-4.18.0-348.12.2.el8_5.x86_64                                                                                  2/3
  Installing       : kernel-4.18.0-348.12.2.el8_5.x86_64                                                                                          3/3
  Running scriptlet: kernel-core-4.18.0-348.12.2.el8_5.x86_64                                                                                     3/3
dracut: dracut module 'network-legacy' cannot be found or installed.
warning: %posttrans(kernel-core-4.18.0-348.12.2.el8_5.x86_64) scriptlet failed, exit status 1

There is a nice solution about it:
Solution 5672791

Problem is that I have already dracut-network installed. In fact removed it and reinstalled several times, same with kernel

[root@VPL-SPR-DNS02 35network-legacy]# rpm -qa | grep dracut-network
dracut-network-049-191.git20210920.el8.x86_64

Any idea why this can be happening?

Thanks!!!

Responses

Well if it is from help to someone, it seems that in my case, the culprit was the package dhcp-client. For some reason, it did not come, and without the command dhclient, dracut module network-legacy cannot be invoked and, that fails to generate the initramfs for the new kernel, and that ends in the kernel panic.

Cheers

I probably just ran into the same problem with a newer kernel. The system would come up after a regular scheduled reboot and via the drac console I could see that the kernel image was missing. So, I rebooted and chose the previoous kernel and the system booted correctly.

I then removed the last installed kernel-core and tried reinstalling it:

Running transaction Preparing : 1/1 Installing : kernel-core-4.18.0-372.9.1.el8.x86_64 1/3 Running scriptlet: kernel-core-4.18.0-372.9.1.el8.x86_64 1/3 Installing : kernel-modules-4.18.0-372.9.1.el8.x86_64 2/3 Running scriptlet: kernel-modules-4.18.0-372.9.1.el8.x86_64 2/3 Installing : kernel-4.18.0-372.9.1.el8.x86_64 3/3 Running scriptlet: kernel-core-4.18.0-372.9.1.el8.x86_64 3/3 dracut: dracut module 'network-legacy' cannot be found or installed. warning: %posttrans(kernel-core-4.18.0-372.9.1.el8.x86_64) scriptlet failed, exit status 1

Error in POSTTRANS scriptlet in rpm package kernel-core Running scriptlet: kernel-4.18.0-372.9.1.el8.x86_64 3/3 Verifying : kernel-modules-4.18.0-372.9.1.el8.x86_64 1/3 Verifying : kernel-4.18.0-372.9.1.el8.x86_64 2/3 Verifying : kernel-core-4.18.0-372.9.1.el8.x86_64 3/3

Installed products updated.

Although it said it was properly installed I thought it wise to google the error and ended up here. I removed the kernel bits again, installed dhcp-client and tried again. This time no errors while running the scriptlets. And, most importantly, system rebooted with the new kernel just fine this time around

Well, happy I am not alone, and it served someone :)

I am getting the same issues to the T. I tried the suggested even though I'm not sure I follow the logic. I uninstalled kernel 372, installed dhcp-client, then attempted to reinstall kernel 372. Still the same errors.

Edit: Issue resolved. My issues seemed to be specific to dracut-network. Once I installed this package I was able to reinstall kernel with no issues. Thanks for the help gentlemen!