So I'm trying to install the nvidia drivers for my laptop (it has GeForce 940MX) but without luck.

I'm trying to install them by typing:

 sudo ubuntu-drivers autoinstall

Unfortunately this fails and gives the following output:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nvidia-driver-396 : Depends: nvidia-dkms-396 (= 396.54-0ubuntu0~gpu18.04.1) but it is not going to be installed
                     Depends: nvidia-utils-396 (= 396.54-0ubuntu0~gpu18.04.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-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-decode-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-encode-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-ifr1-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-fbc1-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
                     Recommends: libnvidia-gl-396:i386 (= 396.54-0ubuntu0~gpu18.04.1)
E: Unable to correct problems, you have held broken packages.

Can you please explain me what the exact problem is (I'm having some hard time trying to understand it) and what should I do to fix it?

  • Where does nvidia-driver-396 come from? 18.04 only seems to have version 390 in the repositories. Sep 22, 2018 at 14:32
  • I added the ppa:graphics-drivers/ppa repository.
    – dephinera
    Sep 22, 2018 at 14:36
  • ...and how many Nvidia drivers do you have installed? For example, what's the output of dpkg -l | grep nvidia? Sep 22, 2018 at 14:44
  • @mikewhatever the output from this is empty
    – dephinera
    Sep 22, 2018 at 14:45
  • 1
    Try directly & try with apt-get, sudo apt-get install nvidia-driver-396
    – doug
    Sep 22, 2018 at 14:56

2 Answers 2


Some of the packages have unmet dependencies, likely because the PPA, but it's unclear. My advice is first remove the PPA by using:

sudo apt-add-repository -r ppa:graphics-drivers/ppa

(Note the -r means remove)

Next you want to make sure your package listing is up-to-date:

sudo apt update

Next you should likely remove all the nvidia packages you might have installed:

sudo apt remove nvidia*
sudo apt autoremove

Now with a fresh slate try to invoke the driver auto installer:

sudo ubuntu-drivers autoinstall

If you still get problems with held packages, it could be because you updated some packages while the PPA was enabled, in which case I would suggest running:

sudo apt install aptitude
sudo aptitude install <name_of_package_with_conflicts>

This will invoke an interactive series of questions basically showing you all the ways the package could be installed if you were to remove another package or downgrade one, etc. Step through them until you find the option that fits your needs (you don't have to accept the first option given)

  • Thank you for your answer. Unfortunately I'm not sure the solutions aptitude suggests will work. They involve either not doing anything or downgrading some stuff while leaving other uninstalled or removing things I need..
    – dephinera
    Sep 22, 2018 at 15:32
  • Try downgrading, it will likely downgrade a library that was updated when the PPA was active. Sep 22, 2018 at 15:41
  • So I got stuck... I resolved some dependencies but not all of them. When I try to run "sudo ubuntu-drivers autoinstall" I get nvidia-384 : Depends: libgl1 while libgl1 is installed already. I also get error for xorg-video-abi-23. Aptitude didn't show any solutions for these two.
    – dephinera
    Sep 22, 2018 at 16:17
  • 3
    Just a FYI: I did sudo apt-add-repository -r ppa:graphics-drivers/ppa and removed nvidia etc and then sudo apt-add-repository ppa:graphics-drivers/ppa. Then ubuntu-drivers devices shows the correct drivers, and sudo apt install nvidia-driver-415 worked fine (requires restart).
    – H. Arponen
    Dec 17, 2018 at 12:37
  • I had to try this sudo aptitude install <name_of_package_with_conflicts> command multiple times to get it to install my version correctly. At first, I thought it successfully installed, but after reboot, running nvidia-smi did not output anything useful. Then I ran the sudo aptitude install <name_of_package_with_conflicts>, tried answering the y/n questions and after a few tries, including rebooting, I got it right.
    – jsibs
    Jan 19, 2023 at 20:07

You have broken dependencies. Try fixing them with

$ sudo apt -f install

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