When dnf update kernel failed to generate initramfs

By: | Comments: No Comments

Posted in categories: Computer Tips, Work related

This sometimes happen when the automatic nvidia kernel module installation fails.

The workaround is:

  1. Boot into an older kernel;
  2. ls /boot/ and find the kernel name of the vmlinuz without corresponding initramfs. For example, it could be vmlinuz-6.14.3-300.fc42.x86_64. Your kernel version will be 6.14.3-300.fc42.x86_64, in the form of major.mid,minor-nnn.osver.arch. Let’s call it $KVER
  3. Check the existence of /lib/modules/$KVER/ by ls it. If exists, do “depmod -v $KVER”. This will create modules.dep in the folder /lib/modules/$KVER/.
  4. Do dracut –force –kver $KVER. If not working, use a lower version of gcc like “CC=gcc-14 dracut –force –kver $KVER”.
  5. Reboot into the newest kernel. Usually this will not contail nvidia driver kernel module.
  6. Run the nvidia driver installation downloaded from NVidia driver site, like NVIDIA-Linux-x86_64-570.144.run. This will install the NVidia driver kernel module into the kernel. If not working, use a lower version of gcc, like “CC=gcc-14 ./NVIDIA-Linux-x86_64-570.144.run”
  7. Now you have a good kernel with proper graphic driver kernel module.

Be the first to comment!

Leave a Reply