Score:0

Nvidia driver started to break my apt environment, how can I fix this?

bd flag

After I did a series of commands to install Nvidia driver and nvidia-cuda-toolkit things, it started to log stdout errors whenever I try apt install.

I don't remember what exactly commands I've ran, but I think at least I did the following for instance:

sudo apt install nvidia-cuda-toolkit
sudo apt install nvidia-340

Here is an example output that I get when I do a apt install:

$ sudo apt install cowsay -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
cowsay is already the newest version (3.03+dfsg2-7).
The following packages were automatically installed and are no longer required:
  g++-8 libaccinj64-10.1 libatomic1:i386 libbsd0:i386 libcublas10 libcublaslt10 libcudart10.1 libcufft10 libcufftw10 libcuinj64-10.1
  libcupti-dev libcupti-doc libcupti10.1 libcurand10 libcusolver10 libcusolvermg10 libcusparse10 libdrm-amdgpu1:i386
  libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libffi7:i386
  libfwupdplugin1 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libllvm12:i386
  libncurses5 libnppc10 libnppial10 libnppicc10 libnppicom10 libnppidei10 libnppif10 libnppig10 libnppim10 libnppist10 libnppisu10
  libnppitc10 libnpps10 libnvblas10 libnvgraph10 libnvidia-ml-dev libnvjpeg10 libnvrtc10.1 libnvtoolsext1 libnvvm3 libpciaccess0:i386
  libsensors5:i386 libstdc++-8-dev libstdc++6:i386 libthrust-dev libtinfo5 libvdpau-dev libvulkan1:i386 libwayland-client0:i386
  libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386
  libxcb-randr0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386
  libxshmfence1:i386 libxxf86vm1:i386 libzstd1:i386 mesa-vulkan-drivers:i386 nvidia-cuda-dev nvidia-cuda-doc nvidia-cuda-gdb
  nvidia-opencl-dev nvidia-profiler nvidia-visual-profiler ocl-icd-opencl-dev opencl-c-headers
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 102 not upgraded.
8 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up nvidia-dkms-450 (450.51.05-0ubuntu1) ...
update-initramfs: deferring update (trigger activated)

A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau
from loading. This can be reverted by deleting the following file:
/etc/modprobe.d/nvidia-graphics-drivers.conf

A new initrd image has also been created. To revert, please regenerate your
initrd by running the following command after deleting the modprobe.d file:
`/usr/sbin/initramfs -u`

*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can   ***
*** be loaded.                                                            ***
*****************************************************************************

INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
Removing old nvidia-450.51.05 DKMS files...

------------------------------
Deleting module version: 450.51.05
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-450.51.05 DKMS files...
Building for 5.15.0-56-generic
Building for architecture x86_64
Building initial module for 5.15.0-56-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-dkms-450.0.crash'
Error! Bad return status for module build on kernel: 5.15.0-56-generic (x86_64)
Consult /var/lib/dkms/nvidia/450.51.05/build/make.log for more information.
dpkg: error processing package nvidia-dkms-450 (--configure):
 installed nvidia-dkms-450 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of nvidia-driver-450:
 nvidia-driver-450 depends on nvidia-dkms-450 (= 450.51.05-0ubuntu1); however:
  Package nvidia-dkms-450 is not configured yet.

dpkg: error processing package nvidia-driver-450 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of cuda-drivers-450:
 cuda-drivers-450 depends on nvidia-dkms-450 (>= 450.51.05); however:
  Package nvidia-dkms-450 is not configured yet.
 cuda-drivers-450 depends on nvidia-driver-450 (>= 450.51.05); however:
  Package nvidia-driver-450 is not configured yet.

dpkg: error processing package cuda-drivers-450 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-drivers:
 cuda-drivers depends on cuda-drivers-450 (= 450.51.05-1); however:
  Package cuda-drivers-450 is not configured yet.

dpkg: error processing package cuda-drivers (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because MaxReports is reached already
                                 No apport report written because MaxReports is reached already
                                                                                               dpkg: dependency problems prevent configuration of cuda-runtime-11-0:
 cuda-runtime-11-0 depends on cuda-drivers (>= 450.51.05); however:
  Package cuda-drivers is not configured yet.

dpkg: error processing package cuda-runtime-11-0 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-11-0:
 cuda-11-0 depends on cuda-runtime-11-0 (>= 11.0.2); however:
  Package cuda-runtime-11-0 is not configured yet.

dpkg: error processing package cuda-11-0 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-demo-suite-11-0:
 cuda-demo-suite-11-0 depends on cuda-runtime-11-0; however:
  Package cuda-runtime-11-0 is not configured yet.

dpkg: error processing package cuda-demo-suite-11-0 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                                                                                                            dpkg: dependency problems prevent configuration of cuda:
 cuda depends on cuda-11-0 (>= 11.0.2); however:
  Package cuda-11-0 is not configured yet.

dpkg: error processing package cuda (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-56-generic
Errors were encountered while processing:
 nvidia-dkms-450
 nvidia-driver-450
 cuda-drivers-450
 cuda-drivers
 cuda-runtime-11-0
 cuda-11-0
 cuda-demo-suite-11-0
 cuda
E: Sub-process /usr/bin/dpkg returned an error code (1)

The apt install itself is working, so for example the above installs cowsay successfully, but simply the long error output is just disturbing and since it always ends the command with an error code I cannot tell if the command is succeeded by echo $?.

Ubuntu version (added):

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

How can I fix this and get rid of the error messages?

guiverc avatar
cn flag
*deb* packages are built for specific releases, so it's easiest if you actually tell us what OS/release you're using. It looks like *focal* (20.04), but rather than us guess - it's most helpful if we're told, as that allows us to provide more accurate help for you. What OS/release are you actually running?
Lime avatar
bd flag
Thanks, that's correct, it's 20.04. I'm adding to the edit.
guiverc avatar
cn flag
You're rather behind on security fixes & patches etc.. An updated system has reported itself as 20.04.5 for some time now (refer https://fridge.ubuntu.com/2022/09/01/ubuntu-20-04-5-lts-released/ which shows the ISO release date, but installed systems upgraded before that date). I'd suggest applying all upgrades asap (*esp. if the box is online; and after all upgrades are applied you may have fewer issues, though I suspect it won't help with in your current case*)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.