I recently upgraded Ubuntu on my laptop to 22.04.5. No errors were reported. After the upgrade, my laptop randomly freezes. Sound keeps working, but otherwise the keyboard, screen and mouse/trackpad are unresponsive. The only way out is a hard reboot. Some searching led me to believe the problem is the "nouveau" graphics driver. When I tried to install a Nvidia driver as alternative, the installation process failed. I followed the instructions by "furkanzdm" here:
https://forums.developer.nvidia.com/t/errors-were-encountered-while-processing-dkms/236521/14 to manually purge Nvidia packages and then re-install "nvidia-driver-550", run update-initramfs and reboot.
Then I attempted to switch to using the Nvidia driver by prime-select nvidia
Even though no errors were reported during the purging/installation, the problem persists. Sometimes one minute in, sometimes a few hours, I need to hard reboot - completely unworkable.
I am not an expert and would greatly appreciate some help with determining the root cause and making sure that I have the correct Nvidia driver and it is actually being used (assuming that "nouveau" is indeed the problem).
I have since found a number of similar questions but none seem to have definitive answers. If possible, I would like to avoid installing software from repos other than the official Ubuntu channels (as suggested here System freezes randomly without explicit errors @ Ubuntu 22.04 LTS).
My system is a Lenovo ThinkPad X1 Yoga Gen 6; 11th Gen Intel® Core™ i7-1185G7 @ 3.00GHz × 8; Mesa Intel® Xe Graphics (TGL GT2); GNOME version 42.9; Windowing System Wayland. "proprietary drivers for devices" is enabled.