The installation of the NVIDIA display driver 340 fails in Kubuntu 20.10

14,059

Solution 1

First you should know that NVIDIA supports different graphic driver packages for different GPUs.

NVIDA ended the support of their Linux legacy drivers earlier this year; specifically with the NVIDIA display driver 340 the last supported Linux kernel is 5.4; newer kernels are not supported.

Kubuntu 20.10 ships with Linux 5.8, which is not supported by the latest NVIDIA display driver 340.108. On the other hand Kubuntu 20.04 has long term support until April 2023 and will continue to work with the NVIDIA display driver (provided you don't make use of the newer kernel which comes as part of the LTS Enablement Stacks).

Some third parties are trying to patch the NVIDIA display driver 340 to make it work with newer versions of Linux according to this Launchpad ticket. But keeping up with the new Linux version is not trivial (other distributions already decided against it) and the maintenance of a proprietary driver in a GPL context raises some legal issues.

Alternatively one can remove the proprietary driver (sudo apt-get autoremove --purge nvidia-340) and use the built-in driver of the kernel instead (nouveau). My experience is that the 3D and even the 2D acceleration suffer a lot after switching from the proprietary driver to the open source driver. This would be fine with a more powerful GPU but since my GPU is very old and slow I decided to retire it and to replace it with a newer model which comes with recent drivers.

Solution 2

I am using Ubuntu 20.04 with a NVIDIA GT216. It looks like the nvidia-340 driver is only working with kernel 5.4., so check your devices:

ubuntu-drivers devices

Install the missing kernel:

sudo apt install linux-generic

Check wich kernels are installed:

dpkg -l | egrep -e 'image|generic' | egrep -e linux

Remove the actual kernel:

sudo apt-get remove --purge linux-generic-hwe-20.04 linux-*-5.11.*

Reboot ;-):

reboot

and install the nvidia-driver:

sudo apt install -y nvidia-340
Share:
14,059

Related videos on Youtube

Stéphane Tréboux
Author by

Stéphane Tréboux

Updated on September 18, 2022

Comments

  • Stéphane Tréboux
    Stéphane Tréboux over 1 year

    dpkg fails to configure the NVIDIA display driver 340 in Kubuntu 20.10 with this error message:

    dpkg: error processing package nvidia-340 (--configure):
     installed nvidia-340 package post-installation script subprocess returned error exit status 10
    
  • Stéphane Tréboux
    Stéphane Tréboux over 3 years
    Are you driving a 4K monitor with 4 DVI inputs? I read about 2 but not 4. Or is it even 8K? In any case such a high resolution with a GPU released 12 years ago is odd and interesting. Unfortunately the different Linux based OSes you named will at some point update to Linux 5.8 and the stock driver from nvidia will stop working without modifications. If you need 3D under Linux it may be time to update your GPU.
  • Stéphane Tréboux
    Stéphane Tréboux over 2 years
    I guess that Ubuntu 20.04 LTS automatically updated to the newer kernel from the hardware enablement stack, see wiki.ubuntu.com/Kernel/…. Your answer describes how to go back to the kernel version originaly shipped at the time of the release of Ubuntu 20.04 LTS which still supports the NVIDIA display driver 340.
  • Stéphane Tréboux
    Stéphane Tréboux over 2 years
    Thanks for your answer. I don't think that installing the driver from NVIDIA's website is necessary, Ubuntu provides the same driver here: packages.ubuntu.com/groovy/nvidia-340.
  • Admin
    Admin almost 2 years
    sudo apt-get autoremove --purge nvidia-340 this saved my life on my Linux mint I had unnecessarily changed my nvidia driver and my start menu taskmaster had disappeared