What does "The following packages have been kept back" mean?

When doing an apt-get upgrade I sometimes get a message saying “The following packages have been kept back”. For example:

$ sudo apt-get upgrade                                                                                                
Reading package lists... Done                                                                                                          
Building dependency tree                                                                                                               
Reading state information... Done                                                                                                      
The following packages have been kept back:                                                                                            
  linux-headers-server linux-image-server linux-server                                                                                 
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

What does this mean exactly? Obviously the packages have been held back and not installed, but why?

The follow-on question would be: how does one upgrade these kept back packages?

Asked By: Charles Roper


Basic report is that apt-get upgrade will not upgrade packages for which the package manager would like to delete and reinstall the package. This happens in security patches a lot because, often, it was actually libraries precursor to the final distributable compilation which were patched. The “go ahead and delete things” functionality lives in apt-get dist-upgrade but be sure to run apt-get update first just in case the upstream guys figured something out since you last tried. Sometimes they miss things and fix them quickly.

Answered By: rhoyerboat

Just do

sudo apt-get install linux-headers-server linux-image-server linux-server

to upgrade the held packages.

Then run apt-get upgradeand you will be fine.

Answered By: Robert

the message indicates a potentially unsafe condition

if you are certain you want this change to happen you can just

sudo apt-get install  xxxxx

where xxxx is the held package(s) … typically this will happen when the system knows by performing this install it will have to uninstall other packages … for example

sudo apt-get --with-new-pkgs upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libc6 libc6-dbg
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

however I am OK with going ahead and doing updates on those held packages so I run

sudo apt-get install   libc6 libc6-dbg

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'sudo apt autoremove' to remove it.
Suggested packages:
The following packages will be REMOVED:
  libatomic1:i386 libbsd0:i386 libc6:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386
  libexpat1:i386 libffi6:i386 libgcc1:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libidn2-0:i386 libllvm9:i386
  libnvidia-compute-430:i386 libnvidia-decode-430:i386 libnvidia-encode-430:i386 libnvidia-fbc1-430:i386 libnvidia-gl-430:i386 libnvidia-ifr1-430:i386 libpciaccess0:i386
  libsensors5:i386 libstdc++6:i386 libtinfo6:i386 libunistring2:i386 libx11-6:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386
  libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxshmfence1:i386 libxxf86vm1:i386 zlib1g:i386
The following packages will be upgraded:
  libc6 libc6-dbg
2 upgraded, 0 newly installed, 47 to remove and 0 not upgraded.
Need to get 8,459 kB of archives.
After this operation, 525 MB disk space will be freed.
Do you want to continue? [Y/n] 

since by doing some research I am OK doing this upgrade I say Y to above prompt … now those held packages have been installed and the cost was the elimination of unneeded ancillary 32 bit packages … of course you will have a different set of packages causing this The following packages have been kept back or similar message

Answered By: Scott Stensland

Try apt-get dist-upgrade. From the man page:


dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get
has a “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if
necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve
desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages.

While this command is used to upgrade to a new major version of the operating system, it does not do this by default. The file /etc/apt/sources.list must be changed to the new version and then a dist-upgrade is used.

Answered By: Darin Luckie

If the upgrade would require another package to be deleted, or a new package to be installed, the package will be “kept back.” As the man page for apt-get upgrade explains:

Packages currently installed with new versions available are retrieved
and upgraded; under no circumstances are currently installed packages
removed, or packages not already installed retrieved and installed.

To get past this, you can do

sudo apt-get --with-new-pkgs upgrade

This allows new packages to be installed. It will let you know what packages would be installed and prompt you before actually doing the install.

Answered By: Chad
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.