12

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,705
  • 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 '20 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 '20 at 21:34
  • @Nmath no nothing comes for autoremove, and I am using 440 nvidia drivers. – Abhay Patil Sep 29 '20 at 23:17
  • @user535733 hence I did not do it, cause I didn't want to force anything, as it might break some working things. – Abhay Patil Sep 29 '20 at 23:17
  • @PabloBianchi my question is not how to solve it. Read my question again. – Abhay Patil Sep 30 '20 at 00:08
  • 2
    Please consider reading the answers presented there, I believe you'll find the answer to your question. Also consider improving your manners. – Pablo Bianchi Sep 30 '20 at 00:44
  • @PabloBianchi I am sorry if that sounded rude. It was not intended to be rude at all. And yes, I have read the answers on that post, but I did not get the answer to the question - is it safe to force upgrade using the solutions given in that post. No where in those answers did people claim that it was safe (except dist-upgrade which they said was unsafe). And neither did people say that it will be automatically resolved and in what time frame. Once again sorry if my previous comment sounded rude. – Abhay Patil Sep 30 '20 at 08:03
  • @Nmath I solved it by using the software upgrader in ubuntu. What could be the reason that worked and not the terminal commands? Or was it because I was using the Nouveau drivers. Before the update from the software upgrader, under additional drivers Noveau was selected and now 450 proprietary is selected. – Abhay Patil Oct 02 '20 at 13:12
  • I'm not sure -- it's much more difficult to troubleshoot a problem that's already been solved. In any case, if you have a solution, you should definitely post the answer below so that your contribution is helpful for future visitors. – Nmath Oct 02 '20 at 18:59
  • 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
    – Pierre-Yves Nov 10 '20 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 '21 at 14:29

1 Answers1

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.

Pablo Bianchi
  • 15,657
  • 1
    apt full-upgrade didn't help me, but the following did: sudo apt-get install aptitude sudo aptitude safe-upgrade – LXJ Sep 13 '22 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 '22 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? – Pablo Bianchi Sep 17 '22 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. https://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 for more information on phased updates)" as well) instead. – lindes Oct 24 '22 at 17:56