Hello, I know it is an older thread but this is the only I stumbled upon.
I tried to install the nvidia drivers, and since I have secure boot enabled I tried to sign them, using the help of the Software App.
It automatically detected that I tried to install the drivers and prompted me.
However, something must have gone wrong during that process, because on boot it says that the Nvidia Kernal Modules are not available and that the system is defaulting back to the Nouveau drivers. When I disable secure boot in the Bios they work fine. So I guess something must have gone wrong during the signing step.
My question is now, how can I, besides removing the packages and reverting the grub args, also remove the keys and signatures that were created during the signature step.
So that basically the system is as it was before I attempted to install and sign the drivers.
I didn’t find any good information on google (only how to sign but not how to remove) and the suggestions from AI look a bit shady.
For the sake of completeness here are the suggestions from the AI:
I have more keys and certificates than just these two in the akmods folder, but I am not really sure if I should mess with them.
Also, the first mokutil parameter does not even exist (at least in my version).
This tells me the proper key was not enrolled into the uefi bios.
The AI info you used was only partially correct and did not direct you to the proper instructions for enrolling the key to enable use of secure boot.
Where did you obtain the nvidia driver? Was it installed as per the instructions here?
Instructions for using secure boot are here, as well as in the file /usr/share/doc/akmods/README.secureboot.
We now need to recover from the erroneous instructions given by the AI.
First look at the content of sudo ls -lR /etc/pki/akmods/{certs,private}
You should probably see something like this
Note that the file names given by the AI are only links to the actual files.
If you do not see something like this then please run sudo rm -rf /etc/pki/akmods/{certs,private} so that all remaining residue is removed then reboot to allow the system to automatically recreate new keys for you. (You can also run sudo kmodgenca -a -f to force a recreation of the new keys and avoid both the reboot and removing the old cruft.)
You will need to run sudo akmods --rebuild --force (after the new key has been created) to force recreating the nvidia driver and ensure it is properly signed.
Once the new key is properly created then follow the instructions in the file noted in #2 above and this should enroll the proper keys for use with secure boot.
After rebooting and enrolling the key in mok then you should be able to enable secure boot and the nvidia drivers should then load properly.
Thank you for your quick response and also for moving the issue.
I followed the HowTo Nvidia page but I missed the secure boot part …
So basically I just did: sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
Afterwards, I got a notification from the Gnome Software App that it detected the installation of the nvidia drivers and after clicking on it it performed the creation of the keys and the MOK enrollment for me, but apparently not the signing itself (Or something else went wrong there).
sudo ls -lR /etc/pki/akmods/{certs,private} showed the keys as expected and sudo mokutil --import /etc/pki/akmods/certs/public_key.der said that the keys were already enrolled.
To fix my secure boot issue I only had to run sudo akmods --rebuild --force and after a reboot the system booted with secure boot enabled and the nvidia drivers.
Thank you again for your help.
I will read the instructions next time more careful.
This is because with a new install the first time the nvidia driver is installed it pulls in akmods as a dependency. The keys are automatically built with the first reboot after akmods is installed, which means the driver is not signed when it is first built locally.
Thus, the only step required, as you identified, was to perform the sudo akmods --rebuild --force to remove the unsigned driver and create a new one that was signed, then reboot.
I don’t know how, but if the installation process of akmods could do a post install script to create the keys before the installation terminates it might work.
At present those keys are only created automatically with the first reboot after installation (if they do not already exist) or manually by running the kmodgenca -a command before that reboot.
It would seem that the post install script should be able to run that kmodgenca command after the install and before terminating.