Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just added a PPA repository for the development version of the GIMP, but I get this error

The following packages have been kept back:
  gimp gimp-data libgegl-0.0-0 libgimp2.0

Why and how can I solve it so that I can use the latest version instead of the one I have now?

share|improve this question
How about if you also give us the command you ran, which prompted that response? –  andol Jul 31 '10 at 22:09
apt-get update && apt-get upgrade –  jfoucher Aug 1 '10 at 7:58
Strictly speaking, I would say that is a warning, not an error. –  Kazark Nov 16 '11 at 19:59

11 Answers 11

up vote 243 down vote accepted

According to an article on debian-administration.org,

If the dependencies have changed on one of the packages you have installed so that a new package must be installed to perform the upgrade then that will be listed as "kept-back".

That article says sudo apt-get dist-upgrade will force the installation of those newer packages.


dist-upgrade will install all pending updates, with their new dependencies. If for some reason, you don't want to do that, you should use apt-get install package-name dependency-package-name instead.

share|improve this answer
That worked flawlessly, thanks –  jfoucher Aug 5 '10 at 6:13
As this is an accepted answer needs, it really needs updating to warn about using dist-upgrade on a stable system as many of the other answers below have pointed out. Personally I think there is a simpler/safer answer that needs promoted: apt-get install <list of pkgs> –  Cas Oct 3 '12 at 12:41
Cas, should I just add that it could be dangerous to run a dist-upgrade on a stable system? Why exactly is that dangerous? (I honestly don't know apt all that well.) –  mac9416 Oct 3 '12 at 16:27
There is a Server Fault answer that explains dist-upgrade in a bit more detail. I think its just worth clarifying (not dangerous as such) that it may upgrade the entire system which may be beyond what the user expects/wants i.e. in the OP example they are wondering why gimp is being held back. –  Cas Oct 5 '12 at 16:38
Please note that sudo apt-get dist-upgrade can also remove packages. Consequently, it's best always to inspect the list of changes that will be made before agreeing to them, when running sudo apt-get dist-upgrade. –  Eliah Kagan Mar 22 '13 at 13:56

apt-get dist-upgrade is dangerous for stable environment,

  1. wrong source.list setting and you end up with broken ubuntu.
  2. you might get entire application upgraded to version you dont want.

Use case: kernel upgrade kept back, you just want to upgrade the kernel, dont want to upgrade entire distribution.

Better way to handle kept back package:

sudo aptitude

If you have kept back package you should see Upgradable Packages on top of the list.

  • Hit + on that list
  • Hit g twice
  • Answer debconf stuff if asked
  • Press return to continue
  • Press Q
  • Press yes

Your kept back package installed.

share|improve this answer
apt-get dist-upgrade is only dangerous if you have bad repositories in /etc/apt/sources.list*. It's good to be aware that dist-upgrade upgrades all packages, but with the default repositories, that should be fine. Not using dist-upgrade could be dangerous, as you might miss security updates. –  Flimm Dec 27 '12 at 19:35
apt-get dist-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-get upgrade command will install any package from any software source that is enabled; dist-upgrade is not unique in this way. Furthermore, using aptitude to perform any operation at all, at least on amd64, is much more dangerous than running apt-get dist-upgrade, in a release where bug 831768 isn't fixed. –  Eliah Kagan Mar 22 '13 at 14:03
Using aptitude to resolve the dependency issue worked for me! –  Kzqai Sep 16 '13 at 15:52
+1 aptitude worked like a charm. –  archie hicox Jul 22 '14 at 9:34

Whenever you receive from the command apt-get upgrade the message

The following packages have been kept back:

then to upgrade one or all of the kept-back packages, without doing a distribution upgrade (this is what dist-upgrade does, if I remember correctly) is to issue the command:

apt-get install <list of packages kept back>

this will resolve the kept-back issues and will ask to install additional packages, etc. as was explained by other answers.

share|improve this answer
this is the correct answer –  AntonioD Mar 3 at 23:36

There are normally two reasons you may see this message.

If upgrading the program (via sudo apt-get upgrade) would cause packages to be added or removed, then the program will be held back. You can use sudo apt-get dist-upgrade in this case, which will then offer to add or remove the additional programs.

This is pretty common and usually not an issue. Occasionally (particularly during an Ubuntu alpha) a dist-upgrade will offer to remove a lot of other programs, in which case you probably want to cancel it.

If the program depends on packages or versions that are not available, then the program will be held back. You really can't do anything but wait in this circumstance, since the package is basically uninstallable. This can happen when packages get added to the repository out of order, when a package is renamed, or when a package stops providing a virtual package.

share|improve this answer

Most likely these packages are held back because their installation would create dependency inconsistencies. This can either happen because you are using archives under active development, ppas, or because the mirror you uses is not fully updated.

In the last case, just wait, when the dependencies are resolved it will be installed the next time.


There is another possibility, packages might be held back if there is put a hold on them, or if they are pinned.

share|improve this answer
What do you base that likelihood on, without knowing whatever he ran an apt-get upgrade or an apt-get dist-upgrade (alt. the aptitude equivalents)? –  andol Jul 31 '10 at 22:21
this is the most occurring problem in support questions and bugs –  txwikinger Jul 31 '10 at 22:25
Agreed. You should probably wait and check you apt_preferences. This is often caused by development archives where the and available packages dependencies are changing very quickly. Wait for them to settle down and you may not need to dist-upgrade at all. If you'd still like to dist-upgrade, then look at the NEW packages to be installed and the packages to be removed before going ahead. –  Umang Aug 1 '10 at 2:29
This is my case because I get the "kept back" message using dist-upgrade –  Postadelmaga Aug 17 '12 at 9:02
In cases where this problem is due to a messup with apt preferences (pinning), I found reinstallation of the kept packages helped me: apt-get install --reinstall <packages>. –  tanius Apr 13 '14 at 11:11

This is usually because the package has added a dependency, and upgrade doesn't want to add it for you without permission.

If you run:

sudo apt-get install gimp gimp-data libgegl-0.0-0 libgimp2.0

Then the new versions should be installed together with their new dependency.

share|improve this answer

This worked for me

sudo aptitude full-upgrade
share|improve this answer
Worked for me too! :) Thank you! (Ubuntu 13.10) –  Anton Petrov Oct 31 '13 at 22:02
Even aptitude upgrade worked for me. –  Bibhas Dec 14 '13 at 16:15

I ran into this problem when a new kernel was released. (Possibly because I have unstable updates enabled.) I found the simplest way to do the install was through Ubuntu's graphical installer (update-manager).

share|improve this answer

In actual fact, the switch you need is -deselect-upgrade which installs / removes dependencies for the particular package set involved.

share|improve this answer

I have found that aptitude does a better job at upgrading packages if the versions differ just slightly. I had a situation like this:

me@compy:/etc/apt$ apt-cache policy gzip
  Installed: 1.3.5-15
  Candidate: 1.3.5-15+etch1
  Version table:
     1.3.5-15+etch1 0
        500 http://archive.debian.org etch/main Packages
 *** 1.3.5-15 0
        100 /var/lib/dpkg/status

This made apt-get hold back the update, but aptitude updated it just fine. I'm unsure which algorithm is used to determine if a package should be updated or not. I guess these two had the same version, only a different 'qualifier'. But in any case, apt-get wouldn't update it, but aptitude would.

share|improve this answer

You can also try:

sudo aptitude safe-upgrade.

It's safer than full-upgrade (originally named dist-upgrade) because "packages will not be removed unless they are unused".

From man aptitude:


Upgrades installed packages to their most recent version. Installed packages will not be removed unless they are unused /.../ Packages which are not currently installed may be installed to resolve dependencies unless the --no-new-installs command-line option is supplied.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.