For Pop!_OS 22.04 only. However, the steps (not the commands) should be same for other distributions too
- Unmount and remount /boot/efi as rw
sudo umount $(mount | awk '$3 == "/boot/efi" {print $1}')
sudo mount -o rw /boot/efi
- Uninstall Nvidia drivers
sudo apt purge ~nnvidia
sudo apt autoremove
sudo apt clean
- Reinstall Nvidia drivers
sudo apt update
sudo apt full-upgrade
sudo apt install system76-driver-nvidia
- If your system crashes while doing step 3 or 4, execute the below after a force reboot (hold the power button) and repeat from step 1
sudo dpkg --configure -a
- Reboot