sudo apt search nvidia-driver
For example,
sudo apt install nvidia-driver-470
or
sudo apt install -y nvidia-driver nvidia-cuda-toolkit
returns:
┌─────────────────────────────────┤ Configuring xserver-xorg-video-nvidia ├─────────────────────────────────┐ │ │ │ Conflicting nouveau kernel module loaded │ │ │ │ The free nouveau kernel module is currently loaded and conflicts with the non-free nvidia kernel module. │ │ │ │ The easiest way to fix this is to reboot the machine once the installation has finished. │ │ │ │ <Ok> │ │ │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────┘
sudo reboot -f