11

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.

11
  • 1
    It depends upon the missing dependencies. Simply running sudo apt install <package-name> should fail due to the same missing dependencies. We recommend against forcing package installs without a better reason.
    – user535733
    Sep 29, 2020 at 21:33
  • Does anything come up for suggested removal when you use sudo apt autoremove? Which version of the NVIDIA driver are you using?
    – Nmath
    Sep 29, 2020 at 21:34
  • 2
    Please consider reading the answers presented there, I believe you'll find the answer to your question. Also consider improving your manners. Sep 30, 2020 at 0:44
  • 2
    I had the same problem with version 440 (but only 2 files kept back). (I use ppa:graphics-drivers/ppa repository). Solved it by doing a search on "nvidia" in synaptic manager. It showed 2 broken packages. Marked them for removal (and I also marked the nouveau driver for removal). Applied. Then in terminal did : "sudo ubuntu-drivers devices && sudo ubuntu-drivers autoinstall" -> Version 455 installed without problem Nov 10, 2020 at 23:24
  • 1
    For me selecting a newer version of NVIDIA driver from 470 to 495 under the Additional Drivers tab in the Software & Updates thingy worked.
    – 20-roso
    Dec 23, 2021 at 14:29

1 Answer 1

18

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.

4
  • 1
    apt full-upgrade didn't help me, but the following did: sudo apt-get install aptitude sudo aptitude safe-upgrade
    – LXJ
    Sep 13, 2022 at 13:11
  • 2
    Yeah, I still get The following packages have been kept back when I do sudo apt-get full-upgrade. Seems to me the bottom line is that this is a UX bug, in that apt/apt-get gives no indication about why the packages are held back. I'll try to find or, if necessary, report a bug in the appropriate place (which I'll need to find...)
    – lindes
    Sep 17, 2022 at 16:47
  • @lindes I'm pretty sure your case is not a bug. Which packages? Are listed with sudo apt-mark showmanual? Do you have a default sources.list? Sep 17, 2022 at 18:53
  • 4
    @PabloBianchi - it's a user experience bug, in that it says things have been kept back, but gives no indication as to why, so causes confusion. The reason is because of "Phased Updates" (see e.g. askubuntu.com/q/601/222533 and the comments there, which link to further questions), but there's no indication of such in the user interface. Hence, we have questions like this one on askubuntu... because it's confusing. It wouldn't be so confusing if it said "have been kept back due to phased updates" (with or without "(see <url> for more information on phased updates)" as well) instead.
    – lindes
    Oct 24, 2022 at 17:56

You must log in to answer this question.

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