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.
[ Send Message | View Serge's Scratchpad | View Weblogs ]
apt-get dist-upgradeexactly is compared to the regular
apt-get upgradeIf 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 ]
[ Send Message | 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 ]
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 ]
This comment very good
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | 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 ]
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 ]
[ Send Message | 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 ]
P.
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
Thanks for all your useful comments.
Steve
-- Steve.org.uk
[ Parent | Reply to this comment ]
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 ]
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 ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
Steve
-- Steve.org.uk
[ Parent | Reply to this comment ]
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 ]
Felipe Sateler
[ Parent | Reply to this comment ]
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 ]
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 ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
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.
[ Parent | Reply to this comment ]
The package that is being held back is the new kernel, which I am quite anxious to get :-)
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
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 ]
[ Parent | Reply to this comment ]
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 ]
[ Parent | Reply to this comment ]
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 ]
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 ]
[ Parent | Reply to this comment ]