About a year ago I bought a Dell XPS 15 with a Nvidia graphic card and installed Ubuntu 20.04. After I installed the propietary Nvidia drivers, I was prompted to enter a key for the MOK. I rebooted the computer, entered the key and was happy.
Today I finally decided to install Ubuntu 22.04 and did a clean install. All the installation went fine. I then decided to install the Nvidia drivers (sudo apt install nvidia-driver-520) but I was not prompt to enter a MOK key.
Once I reboot, I got several unusual messages when Ubuntu was booting, culminating in a blank screen. I had to go on recovery mode and change the driver back to Nouveau.
I tried several other versions of NVIDIA driver (nvidia-driver-515, nvidia-driver-520-open and some others I don't remember) and kept getting the same result as before.
Finally, after going through the whole process one more time, I realized that the default display server had changed to Xorg from Wayland and that the boot options on GRUB had change to include a new entry (UEFI Firmware Settings). I tried to install the new Nvidia drivers and this time after reboot I did not get the blank screen again and as of now it seems that the driver is working.
If anyone has an idea of what happened, I would appreciate it. I started writing this post before I had "succeeded" in using the new driver, but I am still very confused how did it get fixed, why did the default display server changed and how I can avoid this happening again.