1

After doing a dist-upgrade from 20.04 to 20.10, I now have broke NVidia drivers that can't be reinstalled. No matter what I do, it ends with:

The following packages have unmet dependencies:
 nvidia-driver-460 : Depends: libnvidia-compute-460 (= 460.67-0ubuntu0~0.20.10.1) but 460.73.01-0ubuntu1 is to be installed
                     Depends: libnvidia-decode-460 (= 460.67-0ubuntu0~0.20.10.1) but it is not going to be installed
                     Depends: libnvidia-encode-460 (= 460.67-0ubuntu0~0.20.10.1) but it is not going to be installed
                     Recommends: nvidia-settings but it is not going to be installed
                     Recommends: nvidia-prime (>= 0.8) but it is not going to be installed
                     Recommends: libnvidia-compute-460:i386 (= 460.67-0ubuntu0~0.20.10.1)
                     Recommends: libnvidia-decode-460:i386 (= 460.67-0ubuntu0~0.20.10.1)
                     Recommends: libnvidia-encode-460:i386 (= 460.67-0ubuntu0~0.20.10.1)
                     Recommends: libnvidia-ifr1-460:i386 (= 460.67-0ubuntu0~0.20.10.1)
                     Recommends: libnvidia-fbc1-460:i386 (= 460.67-0ubuntu0~0.20.10.1)
                     Recommends: libnvidia-gl-460:i386 (= 460.67-0ubuntu0~0.20.10.1)
E: Unable to correct problems, you have held broken packages.

The important part seems to be Depends: libnvidia-compute-460 (= 460.67-0ubuntu0~0.20.10.1) but 460.73.01-0ubuntu1 is to be installed

I tried all kinds of things found in order answers, such as re-adding the ppa and

Tried putting all dependencies in one line:

sudo apt install libnvidia-common-440 libnvidia-compute-460 libnvidia-decode-460 libnvidia-encode-460

Tried:

sudo apt-add-repository ppa:graphics-drivers/ppa
ubuntu-drivers devices
sudo apt install nvidia-driver-460

Tried rebuilding souces:

sudo rm /etc/apt/sources.list 
sudo software-properties-gtk 

then selecting all sources again and sudo apt-get update && sudo apt-get dist-upgrade -y, but Same issue.

Also tried:

sudo apt -f install

No difference.

Then I tried:

sudo apt remove nvidia*
sudo apt autoremove
sudo ubuntu-drivers autoinstall

But same result.

How can I fix this?

4
  • For upgrades, you first should disable all PPAs, then reenable them afterwards. The 460.56 driver is the one from standard repos, does that one work for you? If so, use it. Of course, you'd have to purge all the existing nvidia drivers you got from the PPA before you install it.
    – ubfan1
    Apr 22, 2021 at 17:58
  • Oh, I didn't know that.. is there a way to fix this situation or my system is permanently broken until I do a fresh install? Another question.. how do I target version 460.56? I tried sudo apt install nvidia-driver-460.56 and some other variations but no luck. Thanks a lot!
    – Edy Bourne
    Apr 22, 2021 at 18:02
  • 2
    The use of -y when using dist-upgrade seems negligent. The chance to abort after reading the output is an enormously important protection.
    – user535733
    Apr 22, 2021 at 18:03
  • The package you need is nvidia-driver-460. Or just update through the Software & Updates/Additional Drivers Tab, or the command line program ubuntu-drivers. Check the /etc/modprobe.d directory for anything leftover blacklisting the nouveau driver, which you need after you purge all the nvidia drivers (unless you do the reinstall via a virtual term on the command line).
    – ubfan1
    Apr 22, 2021 at 21:41

2 Answers 2

0

Maybe this nvidia driver is not compatible with the latest kernels. You can find info about legacy drivers on Nvidia's website : https://www.nvidia.com/en-us/drivers/unix/legacy-gpu/

You may have several solutions depending on your hardware (and kernel).

1/ remove nvidia's drivers and install the ubuntu kernel's generic display driver

sudo  systemctl  stop  lightdm.service

sudo  apt  purge  '^nvidia-*'

sudo  apt  install  xserver-xorg-video-nouveau

sudo  reboot  now

2/ replace nvidia-driver-460 by another one from Ubuntu which is likely to be compatible with your GPU and still maintained for your kernel; you may browse the documentations like :

3/ try another driver from Nvidia which is compatible with your hardware; nvidia provides compatibility info and downloads :

The first solution seems easier but may not allow to get benefit of all features of your hardware.

I hope that will help...

0

What I have seen is that the makefiles of some nvidia modules contain a very sketchy

CC=cc

line and then proceed with compilations that issue gcc specific commands and directives to build their modules during installation. I suspect that whatever generated that makefile is not aware that cc is a placeholder for the system's default C compiler and that it is not required to be gcc.

Some people prefer clang over gcc, so they override their systen's default compiler. If the module build scripts assume you're using gcc, some packages will be configured incorrectly and cause problems when installing drivers. I've had this issue before with nvidia drivers.

So if you changed cc to something of your choosing, you should try setting cc back to gcc temporarily using

update-alternatives --config cc

as root, and select gcc (usually option 0). Then retry the driver installation. Don't forget to change it back to what you had before when you're done.

And no

CC=gcc apt install nvidia-driver-<version>

sadly does not work.

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