When I upgraded my ubuntu 22.04 (kernel-version 6.2.0-32-generic), the system ran into a problem with the graphic drivers and the screen went black. After force-restarting and trying to upgrade again, I get the following error message:
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
nvidia-dkms-535 : Depends: nvidia-kernel-common-535 (= 535.104.05-0ubuntu1) but 535.104.05-0ubuntu0.22.04.3 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
When I run apt --fix-broken install
as suggested, I get:
The following packages were automatically installed and are no longer required:
libgl1-amber-dri nvidia-firmware-535-535.104.05
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
nvidia-kernel-common-535
The following packages will be upgraded:
nvidia-kernel-common-535
1 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
12 not fully installed or removed.
Need to get 0 B/38,2 MB of archives.
After this operation, 61,2 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 file:/var/cuda-repo-ubuntu2204-12-2-local nvidia-kernel-common-535 535.104.05-0ubuntu1 [38,2 MB]
(Reading database ... 534052 files and directories currently installed.)
Preparing to unpack .../nvidia-kernel-common-535_535.104.05-0ubuntu1_amd64.deb ...
Unpacking nvidia-kernel-common-535 (535.104.05-0ubuntu1) over (535.104.05-0ubuntu0.22.04.3) ...
dpkg: error processing archive /var/cuda-repo-ubuntu2204-12-2-local/./nvidia-kernel-common-535_535.104.05-0ubuntu1_amd64.deb (--unpack):
trying to overwrite '/lib/firmware/nvidia/535.104.05/gsp_ga10x.bin', which is also in package nvidia-firmware-535-535.104.05 535.104.05-0ubuntu0.22.04.4
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cuda-repo-ubuntu2204-12-2-local/./nvidia-kernel-common-535_535.104.05-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
In this solution, the problem was resolved by using sudo dpkg --force-all -P nvidia-firmware-535-535.54.03 nvidia-kernel-common-535 nvidia-compute-utils-535
and then sudo apt --fix-broken install
. When I try this, I get:
~$: sudo dpkg --force-all -P nvidia-firmware-535-535.54.03 nvidia-kernel-common-535 nvidia-compute-utils-535
dpkg: warning: ignoring request to remove nvidia-firmware-535-535.54.03 which isn't installed
dpkg: nvidia-kernel-common-535: dependency problems, but removing anyway as you requested:
nvidia-driver-535 depends on nvidia-kernel-common-535 (<= 535.104.05-1).
nvidia-driver-535 depends on nvidia-kernel-common-535 (>= 535.104.05).
nvidia-driver-535 depends on nvidia-kernel-common-535 (<= 535.104.05-1).
nvidia-driver-535 depends on nvidia-kernel-common-535 (>= 535.104.05).
nvidia-dkms-535 depends on nvidia-kernel-common-535 (= 535.104.05-0ubuntu1).
cuda-drivers-535 depends on nvidia-kernel-common-535 (>= 535.104.05).
(Reading database ... 534052 files and directories currently installed.)
Removing nvidia-kernel-common-535 (535.104.05-0ubuntu0.22.04.3) ...
update-initramfs: deferring update (trigger activated)
Purging configuration files for nvidia-kernel-common-535 (535.104.05-0ubuntu0.22.04.3) ...
update-initramfs: deferring update (trigger activated)
dpkg: nvidia-compute-utils-535: dependency problems, but removing anyway as you requested:
nvidia-driver-535 depends on nvidia-compute-utils-535 (= 535.104.05-0ubuntu0.22.04.3).
cuda-drivers-535 depends on nvidia-compute-utils-535 (>= 535.104.05).
Removing nvidia-compute-utils-535 (535.104.05-0ubuntu0.22.04.3) ...
Purging configuration files for nvidia-compute-utils-535 (535.104.05-0ubuntu0.22.04.3) ...
Processing triggers for initramfs-tools (0.140ubuntu13.4) ...
update-initramfs: Generating /boot/initrd.img-6.2.0-32-generic
Processing triggers for man-db (2.10.2-1) ...
Then, fix broken install:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
cuda-cccl-12-2 cuda-command-line-tools-12-2 cuda-compiler-12-2 cuda-crt-12-2 cuda-cudart-12-2 cuda-cudart-dev-12-2 cuda-cuobjdump-12-2 cuda-cupti-12-2 cuda-cupti-dev-12-2 cuda-cuxxfilt-12-2
cuda-documentation-12-2 cuda-driver-dev-12-2 cuda-gdb-12-2 cuda-libraries-12-2 cuda-libraries-dev-12-2 cuda-nsight-12-2 cuda-nsight-compute-12-2 cuda-nsight-systems-12-2 cuda-nvcc-12-2 cuda-nvdisasm-12-2
cuda-nvml-dev-12-2 cuda-nvprof-12-2 cuda-nvprune-12-2 cuda-nvrtc-12-2 cuda-nvrtc-dev-12-2 cuda-nvtx-12-2 cuda-nvvm-12-2 cuda-nvvp-12-2 cuda-opencl-12-2 cuda-opencl-dev-12-2 cuda-profiler-api-12-2
cuda-sanitizer-12-2 cuda-toolkit-12-2 cuda-toolkit-12-2-config-common cuda-toolkit-12-config-common cuda-toolkit-config-common cuda-tools-12-2 cuda-visual-tools-12-2 gds-tools-12-2 libcublas-12-2
libcublas-dev-12-2 libcufft-12-2 libcufft-dev-12-2 libcufile-12-2 libcufile-dev-12-2 libcurand-12-2 libcurand-dev-12-2 libcusolver-12-2 libcusolver-dev-12-2 libcusparse-12-2 libcusparse-dev-12-2
libgl1-amber-dri libnpp-12-2 libnpp-dev-12-2 libnvidia-cfg1-535 libnvidia-common-535 libnvidia-extra-535 libnvidia-fbc1-535 libnvidia-fbc1-535:i386 libnvidia-gl-535 libnvidia-gl-535:i386 libnvjitlink-12-2
libnvjitlink-dev-12-2 libnvjpeg-12-2 libnvjpeg-dev-12-2 libtinfo5 libxnvctrl0 nsight-compute-2023.2.2 nsight-systems-2023.2.3 nvidia-dkms-535 nvidia-firmware-535-535.104.05 nvidia-kernel-common-535
nvidia-kernel-source-535 nvidia-modprobe nvidia-settings screen-resolution-extra xserver-xorg-video-nvidia-535
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libnvidia-cfg1-535 libnvidia-compute-525 libnvidia-fbc1-535 libnvidia-fbc1-535:i386 libnvidia-gl-535 libnvidia-gl-535:i386 nvidia-kernel-common-535 xserver-xorg-video-nvidia-535
The following packages will be REMOVED:
cuda cuda-12-2 cuda-demo-suite-12-2 cuda-drivers cuda-drivers-535 cuda-runtime-12-2 libnvidia-compute-535 libnvidia-compute-535:i386 libnvidia-decode-535 libnvidia-decode-535:i386 libnvidia-encode-535
libnvidia-encode-535:i386 nvidia-driver-535 nvidia-utils-535
The following NEW packages will be installed:
libnvidia-compute-525 nvidia-kernel-common-535
The following packages will be upgraded:
libnvidia-cfg1-535 libnvidia-fbc1-535 libnvidia-fbc1-535:i386 libnvidia-gl-535 libnvidia-gl-535:i386 xserver-xorg-video-nvidia-535
6 upgraded, 2 newly installed, 14 to remove and 9 not upgraded.
12 not fully installed or removed.
Need to get 55,2 MB/310 MB of archives.
After this operation, 101 MB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://de.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 libnvidia-compute-525 amd64 525.125.06-0ubuntu0.22.04.1 [55,2 MB]
Get:2 file:/var/cuda-repo-ubuntu2204-12-2-local nvidia-kernel-common-535 535.104.05-0ubuntu1 [38,2 MB]
Get:3 file:/var/cuda-repo-ubuntu2204-12-2-local xserver-xorg-video-nvidia-535 535.104.05-0ubuntu1 [1.506 kB]
Get:4 file:/var/cuda-repo-ubuntu2204-12-2-local libnvidia-cfg1-535 535.104.05-0ubuntu1 [99,5 kB]
Get:5 file:/var/cuda-repo-ubuntu2204-12-2-local libnvidia-fbc1-535 535.104.05-0ubuntu1 [51,4 kB]
Get:6 file:/var/cuda-repo-ubuntu2204-12-2-local libnvidia-fbc1-535 535.104.05-0ubuntu1 [55,9 kB]
Get:7 file:/var/cuda-repo-ubuntu2204-12-2-local libnvidia-gl-535 535.104.05-0ubuntu1 [182 MB]
Get:8 file:/var/cuda-repo-ubuntu2204-12-2-local libnvidia-gl-535 535.104.05-0ubuntu1 [32,1 MB]
Fetched 55,2 MB in 1s (61,1 MB/s)
Selecting previously unselected package nvidia-kernel-common-535.
(Reading database ... 534025 files and directories currently installed.)
Preparing to unpack .../nvidia-kernel-common-535_535.104.05-0ubuntu1_amd64.deb ...
Unpacking nvidia-kernel-common-535 (535.104.05-0ubuntu1) ...
dpkg: error processing archive /var/cuda-repo-ubuntu2204-12-2-local/./nvidia-kernel-common-535_535.104.05-0ubuntu1_amd64.deb (--unpack):
trying to overwrite '/lib/firmware/nvidia/535.104.05/gsp_ga10x.bin', which is also in package nvidia-firmware-535-535.104.05 535.104.05-0ubuntu0.22.04.4
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cuda-repo-ubuntu2204-12-2-local/./nvidia-kernel-common-535_535.104.05-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I think I made it worse because now there are more unmet dependencies…
Can anyone help me to resolve these conflicts?