13

On doing sudo apt upgrade, I get the following error (or warning, not sure what it is):

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libnvidia-cfg1-440 libnvidia-compute-440 libnvidia-compute-440:i386 libnvidia-decode-440 libnvidia-decode-440:i386 libnvidia-encode-440 libnvidia-encode-440:i386
  libnvidia-extra-440 libnvidia-fbc1-440 libnvidia-fbc1-440:i386 libnvidia-gl-440 libnvidia-gl-440:i386 libnvidia-ifr1-440 libnvidia-ifr1-440:i386
  nvidia-compute-utils-440 nvidia-driver-440 nvidia-kernel-common-440 nvidia-kernel-source-440 nvidia-utils-440 xserver-xorg-video-nvidia-440
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.

I found the solution (run sudo apt install <package-name>). I also found out why it does so. It is because the newer version has unmet dependencies.

But my doubt is, is it safe to do sudo apt install <package-name>, or will the system take care of it in a few days. If so, then how many days would it take to resolve this on its own?

EDIT 1:
My current Nvidia Drivers are 440.

Abhay Patil
  • 2,793

1 Answers1

21

There are normally four reasons why you may see this message:

  • The upgrade procedure needs to add packages: Use --with-new-pkgs upgrade. Without this, apt upgrade won't add or remove new packages.

  • The upgrade procedure needs to remove packages: Double-check your apt configuration, which packages will be removed, analyze the possible consequences, check your backups… and only then: apt full-upgrade. Will add or remove packages as necessary to complete the upgrade.

    apt full-upgrade is only dangerous if you have bad repositories in /etc/apt/sources.list*. It's good to be aware that full-upgrade upgrades all packages, but with the default repositories, that should be fine. Not using full-upgrade could be dangerous, as you might miss security updates.source

    apt full-upgrade can remove as well as add packages, but it is not really dangerous. Any package installation command can cause serious damage if you have problems in your sources.list file! A regular apt upgrade command will install any package from any software source that is enabled; full-upgrade is not unique in this way.source

  • Relevant packages are marked as held back: sudo apt-mark showmanual | grep nvidia (for e.g.), one of the listed packages are the trouble ones listed by apt upgrade? In this case should be analyzed who/why these packages were marked like that.

    For example, I had an issue with flatpak, fixed by moving from 1.11.1 to 1.14.4 by adding its PPA. For some reason, flatpak mark as held back xdg-desktop-portal (desktop integration portal for Flatpak and Snap).

  • It depends on packages or versions that are not available: This might be a temporary issue or an apt misconfiguration.

    • This temporary case could sometimes be related to Phased Updates (also here):

      Once an update is released to -updates, the update is then phased so that the update is gradually made available to expanding subsets of Ubuntu users. This process allows us to automatically monitor for regressions and halt the update process if any are found.

      The Phased-Update-Percentage is initially set to 10%, and a job is run (every 6 hours) that checks for regressions and if none are found the phased update percentage will be incremented by 10%. So an update will become fully phased after 54 hours or about 2 days.

      Update Manager is currently the only package manager that supports phased updates. Any other update mechanism installs all updates regardless of the Phased-Update-Percentage.

Other notes

  • Unsure about using full-upgrade? Try it with --dry-run. From apt manual:

    -s, --simulate, --just-print, --dry-run, --recon, --no-act: No action; perform a simulation of events that would occur based on the current system state but do not actually change the system.

  • dist-upgrade will not update the whole distribution (like do-release-upgrade). It is a misnomer. full-upgrade is equivalent. Avoid using dist-upgrade.

  • Use apt command, the friendly alternative to apt-get.


Sometimes sudo ubuntu-drivers install might try to downgrade your NVIDIA drivers. I'm not sure why.

Pablo Bianchi
  • 17,371