Some upgrades show packages being kept back

Posted by Steve on Sun 2 Jan 2005 at 14:54

Sometimes when you go to upgrade your machine with apt-get you will see that a package is being "kept back".

Normally to upgrade a machine you would run:

apt-get update
apt-get upgrade

This should upgrade all the installed packages upon your machine (well at least all those packages which you have installed that have a newer version available), but it doesn't always do that.

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".

For example my apt-get upgrade today showed this:

root@sun:~# apt-get upgrade
Building Dependency Tree... Done
The following packages have been kept back:
  bind9-host dnsutils imagemagick libmagick6
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

There we can see four packages haven't been upgraded, even though newer packages are available. This is because two new packages were introduced, and these upgrades depend upon it.

To fix this you must run :

apt-get dist-upgrade

This will upgrade the packages that have newer versions available, and install any new dependencies which are required to do that.

root@sun:~# apt-get dist-upgrade 
Reading Package Lists... Done
Building Dependency Tree... Done
Calculating Upgrade... Done
The following NEW packages will be installed:
  libdns16 libdps1
The following packages will be upgraded:
  bind9-host dnsutils imagemagick libmagick6
4 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 3697kB of archives.
After unpacking 1860kB of additional disk space will be used.
Do you want to continue? [Y/n] 

Here we can see the two new packages which are required to satisfy the dependencies of the upgrades, libdns16 and libdps1.

 

 


Posted by Serge (213.224.xx.xx) on Sun 2 Jan 2005 at 20:31
[ View Serge's Scratchpad | View Weblogs ]
Kudos to you Steve, you're the first who manages to give that simple explanation about what
apt-get dist-upgrade
exactly is compared to the regular
apt-get upgrade
If I may try to rephrase: 'Apt-get dist-upgrade'ing also installs new packages brought in the chain of dependencies, whereas 'apt-get upgrade'ing only install newer versions of packages already installed. After a couple of years working with Debian, I never managed to exactly understand that difference. Would you believe I never found documentation who states this as simple? Although, to be complete, you can have other reason's why packages are being kept back. I don't have an example handy, but an obvious reason might be when one had been playing around with repositories, and not all necessary packages (dependencies) are in the current defined repositories. Serge van Ginderachter

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sun 2 Jan 2005 at 22:39
[ View Steve's Scratchpad | View Weblogs ]

I'm glad you found that useful .. the difference is explained briefly in the manpage for apt-get - in the dist-upgrade section, but it would be nice if it were more explicit.

I guess there are a couple of other ways you could get into that state, if you were using pinning or playing with lots of different repositories - but this seems to be the most common one.

I guess I should write about pinning sometime soon, unless somebody else does it for me ;)

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by Anonymous (89.49.xx.xx) on Sat 6 Oct 2007 at 20:33
One example is when you have a line like

deb http://security.debian.org/ stable/updates main

in sources.list, but the other lines contain the explicit name of a version, say sarge. Now sarge is no longer stable, but oldstable, and even a dist-upgrade will hold the related updates back.

Running the dist-upgrade with the -V switch clarifies what happens. Example:

The following packages have been kept&nb sp;back:
    openssl  [0.9.7e-3sarge4&n bsp;-> 0.9.8c-4etch1] 



-aw-

[ Parent | Reply to this comment ]

Posted by eak (88.254.xx.xx) on Fri 20 Jun 2008 at 08:47
Thanks,

This comment very good

[ Parent | Reply to this comment ]

Posted by Anonymous (195.202.xx.xx) on Sat 23 Jan 2010 at 11:09
thanks, that helped me a lot

[ Parent | Reply to this comment ]

Posted by Anonymous (148.107.xx.xx) on Thu 22 Mar 2012 at 17:01
You would think apt-get would include the phrase "You might want to run apt-get dist-upgrade to fix this problem." instead of letting everyone who encounters this problem be clueless. Gezz!

[ Parent | Reply to this comment ]

Posted by ybiC (68.96.xx.xx) on Tue 4 Jan 2005 at 13:21
Another, more granular, option is to apt-get install the recalcitrant package. This seems to do pretty much the same thing as described in you describe, but on a one-problem-package-at-a-time basis instead of globally. KnowwhatImeanVerne?

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sun 6 Feb 2005 at 19:19
[ View Steve's Scratchpad | View Weblogs ]

True .. although it could take a while if there are a lot of packages which are held back!

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by Anonymous (85.223.xx.xx) on Mon 3 Aug 2009 at 14:56
No, you can copy and paste all the packages at once after "apt-get install ". No need to install them one by one.

[ Parent | Reply to this comment ]

Posted by robamler (141.84.xx.xx) on Sun 16 Oct 2011 at 12:28
I'm not an expert but based on the way I understand apt-get I wouldn't recommend doing an explicit "apt-get install" for the kept-back packages. In addition to installing the latest version of the package and all its dependencies, "apt-get install" also marks the package as explicitly requested by the user, which will prevent it from being removed by an "apt-get autoremove" once it's no longer needed.

E.g. say a long time ago you did an "apt-get install A" where the package A depended on some package B which in turn depended on some package C. Now a new version of package B is released which now also depends on some additional package C2.

At this point, in order to get your system fully up to date you will need to do either (1) an "apt-get dist-upgrade" or (2) an explicit "apt-get install B". Now let's say that after some time you decide you no longer need package A, so you do an "apt-get remove A". If you used (1) above then apt-get will inform you at this point that you no longer need the packages B, C and C2 and you can remove them all with an "apt-get autoremove". In contrast, if you had used (2) above then you wouldn't be told about the obsolete installed packages and it's unlikely that you would remember to delete them manually.

In a nutshell: "apt-get dist-upgrade" is better than a manual "apt-get install B" because it not only tells apt-get *what* you want to do (install C2) but also *why* you want to do it (to fulfill the changed dependencies of some already installed package). The more semantics you give to apt-get the better it can maintain metadata and therefore the better it can assist you to keep your system clean. "dist-upgrade" is your actual goal whereas "install B" is just one possible way to achieve it but I would rather leave it to the expert (apt-get) to figure out the best solution for my actual aim.

[ Parent | Reply to this comment ]

Posted by ptecza (83.31.xx.xx) on Sun 6 Feb 2005 at 19:01
Hi!

My small comment: the `apt-get update && apt-get upgrade` couple doesn't upgrade all the installed packages upon machine, but only the packages which newer version is available, of course :)

Regards!

P.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sun 6 Feb 2005 at 19:18
[ View Steve's Scratchpad | View Weblogs ]

I think that's clearly spelt out in the second paragraph where 'dist-upgrade' is shown used on its own.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by ptecza (83.31.xx.xx) on Sun 6 Feb 2005 at 19:39
Probably you're right, Steve. We know how apt-get works, but "This should upgrade..." sentence can be misleading for Debian newbies.

P.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sun 6 Feb 2005 at 19:59
[ View Steve's Scratchpad | View Weblogs ]
I've updated the wording a little bit, as a compromise.

Thanks for all your useful comments.

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by ptecza (83.31.xx.xx) on Sun 6 Feb 2005 at 20:30
Thank you very much :)

P.

PS. Is automatic quoting the comment which I reply to possible? It would be very useful, not only for me :)

[ Parent | Reply to this comment ]

Posted by ptecza (83.31.xx.xx) on Sun 6 Feb 2005 at 20:55
Hello!

In my opinion your article would be advisable also for Polish Debian users, so I've just translated it. It's available at http://www.debianusers.pl/article.php?aid=68 and it won't be my last translation :)

Cheers!

P.

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Sun 6 Feb 2005 at 22:40
[ View Steve's Scratchpad | View Weblogs ]
Thanks for that, you're welcome to do more if you have the time. :)

Steve
-- Steve.org.uk

[ Parent | Reply to this comment ]

Posted by UP (24.148.xx.xx) on Tue 22 Mar 2005 at 07:36
found this command useful as a new user:
apt-get clean - clears cache of downloaded packages

if you are more comfortable with a gui you can look into package synaptic for package management

I just had an odd issue where apt-get dist-upgrade and synaptic did not work for one particular package -
it was always kept back for many days

solution I found was
dpkg --purge
apt-get install

The following extra packages will be installed ... 1
The following packages will be REMOVED ... 4
Do you want to continue? [Y/n] y
4 packages deleted
and the new version was installed along with its new dependancy

next tried
apt-get check - updates the package cache and checks
for broken dependencies
everything seems okay

[ Parent | Reply to this comment ]

Posted by fsateler (200.83.xx.xx) on Thu 16 Jun 2005 at 01:06
[ View Weblogs ]
It should be noted that not only installing new packages keep packages from upgrading, but also removing of packages (ie: a conflict marker has been added). In other words, apt-get upgrade keeps back packages which would either install or remove other packages.

Felipe Sateler

[ Parent | Reply to this comment ]

Posted by linulin (212.119.xx.xx) on Wed 12 Apr 2006 at 17:04
Another note (aptitude-related only?): 'aptitude upgrade' displays a prompt where among other commands you can use '+ pkg-name ...' to install additional packages during this upgrade cycle. After adding a package that have been kept-back you are presented with the updated list of actions aptitude is going to perform. So, you see all the new packages that are going to be installed or removed. For example, after adding libgcj-common which was kept-back last time I noticed the following changes:
The following NEW packages will be automatically installed:

gcj-4.1-base
The following NEW packages will be installed:
gcj-4.1-base
The following packages will be upgraded:
libgcj-common


...Bye..Dmitry.

[ Parent | Reply to this comment ]

Posted by csnyder (209.11.xx.xx) on Mon 30 Oct 2006 at 17:20
This was very helpful, but could be made even more so by explaining:

1) How a sysadmin would know that dependencies were added... or is that just a given when a package is held back? One poster indicated that there might be other reasons.

2) Explain a little more about why dist-upgrade is called that. To me, it sounds like "distribution upgrade", which would only apply to system files or something. But it seems to apply to third-party packages as well. I think the first commenter here was talking about the same thing.

So should I always just run apt-get dist-upgrade? Run upgrade first and then dist-upgrade? Or just guess based on the phase of the moon like I do know? :-)

[ Parent | Reply to this comment ]

Posted by Anonymous (84.152.xx.xx) on Mon 13 Nov 2006 at 20:49
So what does it mean then when even an apt-get dist-upgrade complains about packages being kept back.

[ Parent | Reply to this comment ]

Posted by Anonymous (62.30.xx.xx) on Mon 13 Nov 2006 at 21:09
It generally means that some packages have unsatisfiable dependencies, often common in testing/etch. Sometimes a problem even in unstable/sid.

[ Parent | Reply to this comment ]

Posted by mcgyver (213.158.xx.xx) on Mon 1 Jan 2007 at 23:46

Perhaps you wanted to write:

It generally means that some packages have unsatisfiable dependencies, often common in unstable/sid. Sometimes a problem even in testing/etch.

Sid is more "bleeding edge" than Etch.

Alex

[ Parent | Reply to this comment ]

Posted by Anonymous (209.87.xx.xx) on Thu 8 Feb 2007 at 17:34
I have exactly this problem. How can I find out which package has the unsatisfiable dependency?

The package that is being held back is the new kernel, which I am quite anxious to get :-)

[ Parent | Reply to this comment ]

Posted by Anonymous (200.75.xx.xx) on Fri 9 Feb 2007 at 21:11
hehe, Ubuntu, huh?? yeah, same happened to me yesterday... i'm thinking maybe it's just a matter of waiting for the repos to get updated or something... i'm doing an apt-get update right now (it's super slow)... hopefully the dist-upgrade won't hold anything back this time... fingers crossed...

[ Parent | Reply to this comment ]

Posted by Anonymous (200.75.xx.xx) on Fri 9 Feb 2007 at 21:51
okay, i can confirm the sudo apt-get dist-upgrade worked fine today...

[ Parent | Reply to this comment ]

Posted by Anonymous (212.159.xx.xx) on Fri 13 Apr 2007 at 10:27
Doesn't help. You even get that message with apt-get dist-upgrade. The message doesn't tell you why they've been held back, or what you're supposed to do to fix it:

qemu-mips-debian:/etc/apt# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade... Done
The following packages have been kept back:
mailutils
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]?

[ Parent | Reply to this comment ]

Posted by Anonymous (209.11.xx.xx) on Mon 18 Jun 2007 at 21:01
In this case, try apt-get install for the package that is being kept back. You will finally get a little more information about what is going on.

[ Parent | Reply to this comment ]

Posted by Anonymous (59.162.xx.xx) on Sat 14 Apr 2007 at 18:49
Hi My Name is varma I got this issuse and i run apt-get dist-upgrade

Then After i used another command like this i got this error

apt-get upgrade

apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
11 not fully installed or removed.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up netbase (4.29) ...
Installing new version of config file /etc/services ...
dpkg: error processing netbase (--configure):
unable to install `/etc/services.dpkg-new' as `/etc/services': Operation not permitted
dpkg: dependency problems prevent configuration of sendmail-base:
sendmail-base depends on netbase (>= 4.08); however:
Package netbase is not configured yet.
dpkg: error processing sendmail-base (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sendmail-bin:
sendmail-bin depends on sendmail-base; however:
Package sendmail-base is not configured yet.
dpkg: error processing sendmail-bin (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of at:
at depends on mail-transport-agent; however:
Package mail-transport-agent is not installed.
Package sendmail-bin which provides mail-transport-agent is not configured yet.
dpkg: error processing at (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ftp:
ftp depends on netbase; however:
Package netbase is not configured yet.
dpkg: error processing ftp (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mutt:
mutt depends on exim4 | mail-transport-agent; however:
Package exim4 is not installed.
Package mail-transport-agent is not installed.
Package sendmail-bin which provides mail-transport-agent is not configured yet.
dpkg: error processing mutt (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of pidentd:
pidentd depends on netbase; however:
Package netbase is not configured yet.
dpkg: error processing pidentd (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ntpdate:
ntpdate depends on netbase; however:
Package netbase is not configured yet.
dpkg: error processing ntpdate (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of rmail:
rmail depends on sendmail-bin | mail-transport-agent; however:
Package sendmail-bin is not configured yet.
Package mail-transport-agent is not installed.
Package sendmail-bin which provides mail-transport-agent is not configured yet.
dpkg: error processing rmail (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sensible-mda:
sensible-mda depends on sendmail-bin | mail-transport-agent; however:
Package sendmail-bin is not configured yet.
Package mail-transport-agent is not installed.
Package sendmail-bin which provides mail-transport-agent is not configured yet.
dpkg: error processing sensible-mda (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sendmail:
sendmail depends on sendmail-base (= 8.13.8-3); however:
Package sendmail-base is not configured yet.
sendmail depends on sendmail-bin (= 8.13.8-3); however:
Package sendmail-bin is not configured yet.
sendmail depends on sensible-mda (= 8.13.8-3); however:
Package sensible-mda is not configured yet.
sendmail depends on rmail (= 8.13.8-3); however:
Package rmail is not configured yet.
dpkg: error processing sendmail (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
netbase
sendmail-base
sendmail-bin
at
ftp
mutt
pidentd
ntpdate
rmail
sensible-mda
sendmail
E: Sub-process /usr/bin/dpkg returned an error code (1)
can anyone send solution for this problem

my mail address is namburiv@hotmail.com

[ Parent | Reply to this comment ]

Posted by Anonymous (216.169.xx.xx) on Fri 31 Aug 2007 at 12:04
Hey, thanks, this was exactly what I needed and explained really well.

[ Parent | Reply to this comment ]

Posted by Anonymous (82.155.xx.xx) on Wed 13 Feb 2008 at 08:47
Excelent!
Maybe ou can add to rate your documentation pages.
This way, you can find the litles lacks in the documentation

[ Parent | Reply to this comment ]

Posted by BillTotman (216.228.xx.xx) on Tue 11 Mar 2008 at 14:39

To fix 'kept back' packages, the solution is not

apt-get dist-upgrade

Instead, according to the "Upgrading Packages" section of the APT HOWTO, the answer is to run:

apt-get install kept-back-package(s)

I had a situation where amarok and amarok-zine were being held back while I regularly use dist-upgrade. The solution found in the "Upgrading Packages" section of the "APT HOWTO" at debian.org resolved the issue.

This method also one to stick with apt-get upgrade, instead of dist-upgrade, when updating their system.

[ Parent | Reply to this comment ]

Posted by Anonymous (196.11.xx.xx) on Mon 25 Jan 2010 at 13:28
This was exactly what i was missing - because in my case i did not want to (dist)upgrade jaunty to karmic (ubuntu) - thanks!

e.v.

[ Parent | Reply to this comment ]

Posted by Anonymous (136.8.xx.xx) on Tue 3 Jun 2008 at 07:20
Thanks Steve!

[ Parent | Reply to this comment ]

Posted by Anonymous (68.126.xx.xx) on Sat 25 Oct 2008 at 20:06
On my system, it doesn't help:
apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
linux-doc
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
patrick@dbp-consulting.com

[ Parent | Reply to this comment ]

Posted by Anonymous (190.6.xx.xx) on Wed 7 Jan 2009 at 19:56
I got thes results. Any suggestions would be GREATLY appreciated
Emil
emil@emil.net

emil@emil-desktop:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
ffmpeg mjpegtools transcode
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

[ Parent | Reply to this comment ]

Posted by Anonymous (206.207.xx.xx) on Thu 10 Dec 2009 at 09:50
Thank you!

[ Parent | Reply to this comment ]

Posted by Anonymous (203.97.xx.xx) on Mon 21 Dec 2009 at 21:56
Yay, sense has finally been made of this! It is surprising how few people know the difference between apt-get commands for upgrading. There definitely needs to be some better documentation readily available for newcomers to Debian and Ubuntu with respect to apt-get, and using it to resolve dependency problems.

[ Parent | Reply to this comment ]

Posted by Anonymous (98.84.xx.xx) on Thu 4 Mar 2010 at 18:41
Ahhhhhhhh, so that's the reason...

[ Parent | Reply to this comment ]

Posted by Anonymous (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Wed 4 Aug 2010 at 13:26
root@jupiter:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
akregator kaddressbook kdepim-groupware kdepim-kresources kdepim-runtime kdepim-strigi-plugins
kdepim-wizards kmail knotes kontact korganizer ktimetracker libkdepim4 libkleo4 libkpgp4
libksieve4 libmimelib4
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.

Who can help me?

[ Parent | Reply to this comment ]

Posted by Steve (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Wed 4 Aug 2010 at 13:28
[ View Steve's Scratchpad | View Weblogs ]

I'd probably try diagnosing this by seeing what happens if you run:

apt-get install akregator

Or "apt-get install kaddressbook". Probably this is a temporary dependency issue, and the new dependencies aren't available.

Steve

[ Parent | Reply to this comment ]

Posted by Anonymous (99.50.xx.xx) on Wed 29 Dec 2010 at 17:24
Thanks for putting this together!

Update/Upgrade/Dist-Upgrade makes so much sense now that I have read this...

Thank you!

[ Parent | Reply to this comment ]

Posted by Anonymous (82.69.xx.xx) on Thu 3 Mar 2011 at 11:17
Be careful with this tip.

I had libva1 held back and this certainly installed it. But it uninstalled VLC which will currently not install due to unmet dependencies! Apt must have told me and it is my own fault for not reading carefully enough; just be aware that there may be unexpected side-effects.

To quote Bender: Learning is fun!

[ Parent | Reply to this comment ]

Posted by Anonymous (184.1.xx.xx) on Sat 19 Oct 2013 at 20:29
I have always used upgrade and never knew why I had (-5 not upgraded). Thanks so much. Now my question, should I always use dist-upgrade instead? If not, do I only use it when upgrade shows apps held back?

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

What do you use for configuration management?








( 149 votes ~ 0 comments )