


Note: I just invented this method while writing this post. Software & Updates Method 2 (not tested): No PC restart required.
How to install latest nvidia drivers during ubuntu install driver#
Select any other driver except the latest one.Navigate to the "Additional Drivers" tab.Press the window/super key, search for Software & Updates, and open it.Next, there will be several ways to reinstall the NVIDIA driver after the Linux headers are installed Method 1 (tested): UI only. To install the current generic header, you can use the following command sudo apt install -y linux-headers-$(uname -r) The culprit is that after a kernel upgrade, my ubuntu does not install the associated generic linux headers, which causes the NVIDIA driver to fail to be rebuilt. Although NVIDIA does support DKMS (Dynamic Kernel Module Support), which means it is automatically rebuilt after a kernel upgrade, my NVIDIA driver continuously fails after any kernel upgrade. The fact is that when the kernel is upgraded, the NVIDIA driver needs to be re-compiled/reinstalled to be able to be used. Make sure that the latest NVIDIA driver is installed and running. I tried running nvidia-smi, it shows an error message NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Whenever I upgrade the kernel version, after a PC restart, the second display cannot connect. In my NVIDIA card-attached PC, the NVIDIA graphic driver always fails to start every time the Linux kernel is upgraded.
