How to fix broken packages

how can i fix this error?
Linux ubuntu 6.8.0-58-generic #60-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 14 18:29:48 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libnvidia-decode-570 : Depends: libnvidia-compute-570 (= 570.124.06-0ubuntu1) but 570.133.07-0ubuntu0.24.04.1 is installed
 libnvidia-encode-570 : Depends: libnvidia-decode-570 (>= 570.133.07) but 570.124.06-0ubuntu1 is installed
 nvidia-driver-570 : Depends: libnvidia-decode-570 (= 570.133.07-0ubuntu0.24.04.1) but 570.124.06-0ubuntu1 is installed
                     Recommends: libnvidia-compute-570:i386 (= 570.133.07-0ubuntu0.24.04.1)
                     Recommends: libnvidia-decode-570:i386 (= 570.133.07-0ubuntu0.24.04.1)
                     Recommends: libnvidia-encode-570:i386 (= 570.133.07-0ubuntu0.24.04.1)
                     Recommends: libnvidia-fbc1-570:i386 (= 570.133.07-0ubuntu0.24.04.1)
                     Recommends: libnvidia-gl-570:i386 (= 570.133.07-0ubuntu0.24.04.1)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

Ubuntu-Drivers at its finest…not.
Purge Nvidia and start fresh:

sudo apt autoremove --purge nvidia*

Now I install that driver differently than most, but I’l just leave you with the recommended way:

ubuntu-drivers autoinstall

Reboot is it now fixed?

i want to use the drivers i have installed cause Its a headless system.

 dpkg -l | grep nvidia
iU  libnvidia-cfg1-570:amd64             570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-570                 570.124.06-0ubuntu1                     all          Shared files used by the NVIDIA libraries
iU  libnvidia-compute-570:amd64          570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA libcompute package
ii  libnvidia-container-tools            1.17.5-1                                amd64        NVIDIA container runtime library (command-line tools)
ii  libnvidia-container1:amd64           1.17.5-1                                amd64        NVIDIA container runtime library
ii  libnvidia-decode-570:amd64           570.124.06-0ubuntu1                     amd64        NVIDIA Video Decoding runtime libraries
iU  libnvidia-egl-wayland1:amd64         1:1.1.13-1build1                        amd64        Wayland EGL External Platform library -- shared library
iU  libnvidia-encode-570:amd64           570.133.07-0ubuntu0.24.04.1             amd64        NVENC Video Encoding runtime library
iU  libnvidia-extra-570:amd64            570.133.07-0ubuntu0.24.04.1             amd64        Extra libraries for the NVIDIA driver
iU  libnvidia-fbc1-570:amd64             570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
iU  libnvidia-gl-570:amd64               570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
iU  nvidia-compute-utils-570             570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA compute utilities
ii  nvidia-container-toolkit             1.17.5-1                                amd64        NVIDIA Container toolkit
ii  nvidia-container-toolkit-base        1.17.5-1                                amd64        NVIDIA Container Toolkit Base
iU  nvidia-dkms-570                      570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA DKMS package
rc  nvidia-docker2                       2.13.0-1                                all          nvidia-docker CLI wrapper
iU  nvidia-driver-570                    570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA driver metapackage
ii  nvidia-firmware-570-570.124.06       570.124.06-0ubuntu1                     amd64        Firmware files used by the kernel module
iU  nvidia-firmware-570-570.133.07       570.133.07-0ubuntu0.24.04.1             amd64        Firmware files used by the kernel module
iU  nvidia-headless-570                  570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA headless metapackage
iU  nvidia-headless-no-dkms-570          570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA headless metapackage - no DKMS
iU  nvidia-kernel-common-570             570.133.07-0ubuntu0.24.04.1             amd64        Shared files used with the kernel module
iU  nvidia-kernel-source-570             570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA kernel source package
ii  nvidia-modprobe                      570.124.06-0ubuntu1                     amd64        Load the NVIDIA kernel driver and create device files
iU  nvidia-prime                         0.8.17.2                                all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                      570.124.06-0ubuntu1                     amd64        Tool for configuring the NVIDIA graphics driver
iU  nvidia-utils-570                     570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA driver support binaries
ii  screen-resolution-extra              0.18.3                                  all          Extension for the nvidia-settings control panel
iU  xserver-xorg-video-nvidia-570        570.133.07-0ubuntu0.24.04.1             amd64        NVIDIA binary Xorg driver

You still can, you have to first fix your package manager though, right? :wink:

The ubuntu-drivers autoinstall command can be used on headless systems, but there are some considerations to keep in mind. On headless systems, which typically do not have a graphical user interface (GUI), the command may still function, but certain steps or outputs might differ.

How did it get installed in the first place?

nvidia-smi|rg Driver
| NVIDIA-SMI 575.64                 Driver Version: 575.64         CUDA Version: 12.9     |

would running this also fix the problem?

sudo apt-get install libnvidia-decode-570=570.133.07-0ubuntu0.24.04.1 libnvidia-compute-570=570.133.07-0ubuntu0.24.04.1 libnvidia-encode-570=570.133.07-0ubuntu0.24.04.1 nvidia-driver-570=570.133.07-0ubuntu0.24.04.1
1 Like

My many years of nVidia, it’s wise to purge a broken driver to make way for a better chance for a good install, make sense?
My way after the purge is:

sudo apt install nvidia-driver-570 nvidia-dkms-570

Reboot to your working driver.

1 Like

Suggestions above, which tried to fix broken packages, or purge operations would not work as they still has the failing libs.
This solution provided was exactly what I needed as it recommends and provides the list of packages to install, and it works just fine… many thanks for this advice.
I was trying to install them one by one which didn’t work - it took the full command line of all packages at once…