How to Select the Best Driver Number for Your Graphic Card.
Enter your Graphic Card Details and take Reference From this Link
sudo apt install [driver_name]
driver_name = nvidia-(driver number from the link above)
sudo reboot
Ubuntu comes with some preinstalled open-source graphic drivers (Xorg). They are enough for office and some games, but of course they get far less power out of your graphics hardware than a proprietary driver would do. Its advantage is that it is open-source and pretty stable, while proprietary drivers (e.g. those from NVIDIA) often cause problems and are complicated to install correctly.
So you have to decide between simplicity, flexibility and stability (Xorg) and advanced capabilities and best use of the card's power (proprietary).
I did that too, But I still do not have any idea about how to find the drive number. So, I Installed the First one Listed there. Now I am going to try again.
It is personally your choice, how to address the command as per your needs, the command you mentioned deletes all present NVIDIA drivers in one Go, rather than selecting the package name and then purging.
In many cases the desktop is removed turning the screen black after reboot, that is why I think he included the command to reinstall the desktop.
It does confuse a bit...
APT is Advanced Package Tool. APT is not present on the users system, it is what is used to retrieve packages. To Communicate with APT, you must have apt or apt-get installed. Using the apt or apt-get command means you are using the apt software or the apt-get software to communicate with APT to get a package.
You also have other options...
You can install aptitude software, which I personally prefer, for the same function. Aptitude comes with a bit more versatility and helpful prompts.
But in the end, apt, apt-get or aptitude are all software that work with APT to install packages to your system.
User @337harvey has outlined how the current apt is the newer version to apt-get.
You may find some older guides that advise to use apt-get instead of apt. These guides are outdated and reference a time before the current apt manager was released.
After you have downloaded the file NVIDIA-Linux-x86_64-515.65.01.run, change to the directory containing the downloaded file, and as the root user run the executable:
sh ./NVIDIA-Linux-x86_64-515.65.01.run -s
--module-signing-secret-key=/path/to/signing.key
--module-signing-public-key=/path/to/signing.x509
if you get info installation failed then use that command
sh ./NVIDIA-Linux-x86_64-515.65.01.run --add-this-kernel
This will unpack NVIDIA-Linux-x86_64-515.65.01.run, compile a kernel interface layer for the currently running kernel (use the --kernel-source-path and --kernel-output-path options to specify a target kernel other than the currently running one), and create a new installer package with the kernel interface layer added.
That is all.
My graphic card is GTX 1650 Ti on notebook, I tried the recommended one (535) but it runs hotter but indeed perform better utilization but I'd choose the latest 550 as it runs cooler and feels enough for my use case (android emulation).