12

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
5
  • 3
    This is not a bug. this is an announced EOL which many users (like) may not be aware of. NVIDIA announced that their legacy drivers will not support Linux 5.8. There is a launchpad ticket mentioned below but I don't think that NVIDIA will look at the ticket and decide to resume support. I don't think that Kubuntu 20.10 will go back to Linux 5.4 either. Commented Oct 17, 2020 at 2:10
  • 5
    This question is off topic for a while, but you've made your point in the preceding comment. If this problem still exists after Ubuntu 20.10 is officially released as I expect it will, please comment and I will vote to reopen this question at that time.
    – karel
    Commented Oct 17, 2020 at 8:20
  • There are no new changes in changelogs.ubuntu.com/changelogs/pool/restricted/n/… so I must assume that the issue still exists in the official release of Ubuntu 20.10. Commented Oct 23, 2020 at 0:45
  • I just created a live USB stick with Kubuntu 20.10 and the issue can be reproduced by installing nvidia-340 with apt. Commented Oct 23, 2020 at 2:47
  • 3
    Thanks. To be honest I am surprised how little information is circulating about this. For older laptops it means almost no more 3D acceleration, not sure about hardware video decoding. A lot of hardware is going to the bin. Of course this is only NVIDIA's responsibility. But at least Canonical could warn the users of legacy NVIDIA drivers and recommend to stay on 20.04 LTS. Commented Oct 23, 2020 at 3:22

5 Answers 5

14

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.

1
  • 1
    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
    – zzapper
    Commented May 26, 2022 at 13:10
3

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
1
  • 1
    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. Commented Oct 31, 2021 at 21:39
2

Update August 2022

The Ubuntu kernel 5.15.0-58 works great with the custom nvidia-340 driver package developed by kelebek333. So in order to get the old drivers running, the following worked for me. Run as root:

add-apt-repository ppa:kelebek333/nvidia-legacy
apt update
apt install nvidia-340
echo "blacklist nouveau" >> /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs
reboot

Most useful discussion on this matter see here: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1910709

Update February 2023

Kernel 5.19 is not working anymore.

0

I have nvidia FX4700 X2 (dual gpu) with 4 dvi ports that I connect to one monitor with 4 dvi inputs, i.e., one monitor can be divided into two Xscreens with 2 displays per Xscreen. I enabled Xinerama. I have tested many distributions including ubuntu 20.04.1. For the later nvidia-340 works for two displays, unable to make it work for 4 displays. Kaosx 9/2020 works perfectly with 4 displays. Oracle Linux 8.2 works too with 4 displays using nvidia-340xx driver packaged by rpmfusion.org, but not completely working as I don't get video acceleration, still testing this (also no hardware acceleration in vlc and smplayer). Elementary 5.1.7 works with 2 displays and partially on 4 displays (for 4, vlc crashes). Thus far only Kaosx works completely for me and needless to say Windows 10.

1
  • 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. Commented Oct 26, 2020 at 23:53
0

I ended up booting with an older kernel (5.4.x.x) and installing the 340.108 driver (downloaded it from nvidia's website). During the installation, the install script will blacklist the open-source nouveau driver. In my case, the nvidiafb driver was also previously blacklisted (found in /etc/modprobe.d/blacklist-framebuffer.conf). Commenting out the line with nvidiafb did the trick for me.

I am using an old ThinkPad T410 with a really old NVS 3100M graphics card, so I guess unless I upgrade, I'm gonna have to stick with the older kernel.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .