Third-party modules (e.g. Nvidia) are not rebuilt during system upgrade

Problem

If you use a third-party kernel module (the most common is the Nvidia closed driver, but this might also apply to some wireless card drivers, VirtualBox, etc), it won’t be rebuilt during a system upgrade to a newer Fedora version. That means your kernel module (and the affected hardware) might not work directly after the system upgrade. In case of Nvidia, that might mean using a slow fallback graphical driver, or even failing to boot to a graphical environment at all.

Note: This problem definitely applies to DNF System Upgrade. It’s currently unclear whether it also applies to graphical upgrading with the use of GNOME Software, KDE Discover and similar tools.

Cause

The attempt to rebuild third-party kernel driver after at the end of the upgrade fails, but it’s not yet clear why.

Related Issues

Bugzilla report: #2011120

Workarounds

The third-party kernel drivers can be easily rebuilt by running this command in your terminal:

sudo depmod -a

Then just reboot and your system should work as expected.

Alternatively, if that didn’t help, you can try these commands:

sudo dnf remove 'kmod-nvidia-*'
sudo akmods --force

or

sudo akmods --force --rebuild

and reboot again.

Nvidia closed driver
In case of Nvidia, you might not be able to log in and execute the command above. In that case, follow this:

  1. Keep pressing F8 or holding Shift when starting your PC, that should cause the GRUB2 bootloader menu to appear.
  2. Press e to edit the current boot option, find the linux or linuxefi line, and add nomodeset plymouth.enable=0 at the end of it. Then press Ctrl+x to boot.
  3. If the graphics environment doesn’t start, but you see a text console, press Ctrl+Alt+F2, a clean text login prompt should appear.
  4. Log in with your user account, and execute the workaround command specified above.
  5. Reboot your system with sudo systemctl reboot.
  6. The next boot should work as expected, the Nvidia closed driver should function again.

You can discuss this issue here.

12 Likes