What is “dist-upgrade” and why does it upgrade more than “upgrade”?
up vote
353
down vote
favorite
I was wondering why upgrade sometimes doesn't want to upgrade certain parts of the system, while dist-upgrade does. Here's an example after running apt-get upgrade:
apt-get upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
versus apt-get dist-upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.0.0-13 linux-headers-3.0.0-13-generic
linux-image-3.0.0-13-generic
The following packages will be upgraded:
linux-generic linux-headers-generic linux-image-generic
3 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 215 MB of additional disk space will be used.
Do you want to continue [Y/n]?
In other words, why can't this be performed by upgrade?
apt
add a comment |
up vote
353
down vote
favorite
I was wondering why upgrade sometimes doesn't want to upgrade certain parts of the system, while dist-upgrade does. Here's an example after running apt-get upgrade:
apt-get upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
versus apt-get dist-upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.0.0-13 linux-headers-3.0.0-13-generic
linux-image-3.0.0-13-generic
The following packages will be upgraded:
linux-generic linux-headers-generic linux-image-generic
3 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 215 MB of additional disk space will be used.
Do you want to continue [Y/n]?
In other words, why can't this be performed by upgrade?
apt
add a comment |
up vote
353
down vote
favorite
up vote
353
down vote
favorite
I was wondering why upgrade sometimes doesn't want to upgrade certain parts of the system, while dist-upgrade does. Here's an example after running apt-get upgrade:
apt-get upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
versus apt-get dist-upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.0.0-13 linux-headers-3.0.0-13-generic
linux-image-3.0.0-13-generic
The following packages will be upgraded:
linux-generic linux-headers-generic linux-image-generic
3 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 215 MB of additional disk space will be used.
Do you want to continue [Y/n]?
In other words, why can't this be performed by upgrade?
apt
I was wondering why upgrade sometimes doesn't want to upgrade certain parts of the system, while dist-upgrade does. Here's an example after running apt-get upgrade:
apt-get upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-generic linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
versus apt-get dist-upgrade:
rimmer@rimmer-Lenovo-IdeaPad-S10-2:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-3.0.0-13 linux-headers-3.0.0-13-generic
linux-image-3.0.0-13-generic
The following packages will be upgraded:
linux-generic linux-headers-generic linux-image-generic
3 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 215 MB of additional disk space will be used.
Do you want to continue [Y/n]?
In other words, why can't this be performed by upgrade?
apt
apt
edited Jan 24 '17 at 14:05
Bar
1949
1949
asked Nov 22 '11 at 6:03
Richard Rodriguez
3,040102435
3,040102435
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
up vote
294
down vote
accepted
From apt-get manual:
upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. 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. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
dist-upgrade
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.
And with the newer apt tool available from 14.04 onwards:
full-upgrade
full-upgrade performs the function of upgrade but may also remove
installed packages if that is required in order to resolve a
package conflict.
In your particular case, I see, for example, that linux-headers is a virtual package that is provided by both linux-headers-3.0.0-12 and linux-headers-3.0.0-13 and that sounds like the kind of package installation and removal handled by dist-upgrade, but not by upgrade.
4
I don't seefull-upgradeas an option toapt-getunder 14.04.1.
– nobar
May 16 '15 at 2:34
I didn't knew aboutapteither but it seems to be a completely diffrent command according to the man page he linked
– BlueWizard
Oct 20 '15 at 20:37
14
@nobar You don't see because it is an option ofaptand not ofapt-get... :-) Tryman apt.
– Hastur
Oct 29 '15 at 9:47
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
5
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
|
show 2 more comments
up vote
123
down vote
apt-get upgrade is restricted to the case where packages are to be replaced by newer versions, but no package needs to be added or removed. A new version of Firefox, for instance, should be installable with apt-get upgrade.
However apt-get upgrade will refuse to work when there are additions or removals required by the updated versions. For example, when you have kernel linux-image-3.2.0-10-generic installed and linux-image-3.2.0-11-generic appears, the linux-image-generic package gets updated to depend on the newer version. In order to install the new kernel, you need to run apt-get dist-upgrade.
Notice how an apt-get upgrade will say that the kernel packages have been held back. That's the cue for using apt-get dist-upgrade.
2
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
11
The graphical utility,update-manager, does not useapt-getdirectly; instead it works with a backend calledaptdaemon. The standard abilities ofupdate-managerare a mix of theupgradeanddist-upgrademodes ofapt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, useapt-get upgrade. If you see it reports that packages have been "held back", runapt-get dist-upgradeto pick up the remaining updates.
– pablomme
Jan 29 '12 at 2:10
add a comment |
up vote
33
down vote
Basically upgrade will only upgrade existing packages from one version to another. It will not install or remove packages, even if doing so is required to upgrade others. In the case of kernel updates, upgrading the linux-generic package requires installing the new linux-3.0.0-13-generic package, and since upgrade refuses to install or remove packages, it refuses to upgrade linux-generic.
Sometimes various incompatibilities between packages will require some packages to be removed in order to upgrade others, and that will also require dist-upgrade. Kernel updates will always require dist-upgrade because of how they are handled. Rather than have a kernel package that gets updated, an entirely new kernel package is created each time, and the kernel metapackage is updated to depend on the new kernel package instead of the old. This was done so that you keep the old kernel versions around so that in case there is a problem with booting the new kernel, you can choose the old one from the boot menu and recover.
2
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
add a comment |
up vote
11
down vote
The apt-get upgrade command will normally only install updates (or fixes) to currently installed packages. Typically a new release of Mozilla Firefox, for instance, would be installed with this command.
However apt-get upgrade will NOT generally install new releases, where major changes (including removal of packages or GRUB update is required). For example, when a new Linux kernel (linux-image-3.x.x-xx-generic, etc.) is available, the package will not get installed.
In order to install the new kernel, you will need to run apt-get dist-upgrade. You will be notified when you run apt-get upgrade, as it will say that certain packages have been held back. That's your cue to use: apt-get dist-upgrade.
11
This is misleading.dist-upgradewill not upgrade to a new release unlesssources.listhas been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed withdist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false.sudo apt-get upgradeis perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed.update-grubis run automatically, as always.
– Eliah Kagan
Apr 13 '13 at 2:11
2
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
2
Besides what Eliah mentioned, the essential point is thatapt-get upgradewill not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.
– Chan-Ho Suh
May 24 '13 at 3:19
1
Correction:apt-get upgradewill never install or remove any packages. Kernel upgrades are packaged as new packages and as a result,apt-get upgradewill never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference betweenupgradeanddist-upgrade.
– Mikko Rantalainen
Sep 19 '16 at 6:07
add a comment |
up vote
0
down vote
Your best option is:
apt full-upgrade
-which auto-handles the dependencies when upgrading packages; whereas:
apt upgrade
-does NOT auto-handle dependencies when upgrading packages.
-duBtrotterS
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
294
down vote
accepted
From apt-get manual:
upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. 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. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
dist-upgrade
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.
And with the newer apt tool available from 14.04 onwards:
full-upgrade
full-upgrade performs the function of upgrade but may also remove
installed packages if that is required in order to resolve a
package conflict.
In your particular case, I see, for example, that linux-headers is a virtual package that is provided by both linux-headers-3.0.0-12 and linux-headers-3.0.0-13 and that sounds like the kind of package installation and removal handled by dist-upgrade, but not by upgrade.
4
I don't seefull-upgradeas an option toapt-getunder 14.04.1.
– nobar
May 16 '15 at 2:34
I didn't knew aboutapteither but it seems to be a completely diffrent command according to the man page he linked
– BlueWizard
Oct 20 '15 at 20:37
14
@nobar You don't see because it is an option ofaptand not ofapt-get... :-) Tryman apt.
– Hastur
Oct 29 '15 at 9:47
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
5
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
|
show 2 more comments
up vote
294
down vote
accepted
From apt-get manual:
upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. 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. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
dist-upgrade
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.
And with the newer apt tool available from 14.04 onwards:
full-upgrade
full-upgrade performs the function of upgrade but may also remove
installed packages if that is required in order to resolve a
package conflict.
In your particular case, I see, for example, that linux-headers is a virtual package that is provided by both linux-headers-3.0.0-12 and linux-headers-3.0.0-13 and that sounds like the kind of package installation and removal handled by dist-upgrade, but not by upgrade.
4
I don't seefull-upgradeas an option toapt-getunder 14.04.1.
– nobar
May 16 '15 at 2:34
I didn't knew aboutapteither but it seems to be a completely diffrent command according to the man page he linked
– BlueWizard
Oct 20 '15 at 20:37
14
@nobar You don't see because it is an option ofaptand not ofapt-get... :-) Tryman apt.
– Hastur
Oct 29 '15 at 9:47
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
5
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
|
show 2 more comments
up vote
294
down vote
accepted
up vote
294
down vote
accepted
From apt-get manual:
upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. 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. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
dist-upgrade
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.
And with the newer apt tool available from 14.04 onwards:
full-upgrade
full-upgrade performs the function of upgrade but may also remove
installed packages if that is required in order to resolve a
package conflict.
In your particular case, I see, for example, that linux-headers is a virtual package that is provided by both linux-headers-3.0.0-12 and linux-headers-3.0.0-13 and that sounds like the kind of package installation and removal handled by dist-upgrade, but not by upgrade.
From apt-get manual:
upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. 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. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
dist-upgrade
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.
And with the newer apt tool available from 14.04 onwards:
full-upgrade
full-upgrade performs the function of upgrade but may also remove
installed packages if that is required in order to resolve a
package conflict.
In your particular case, I see, for example, that linux-headers is a virtual package that is provided by both linux-headers-3.0.0-12 and linux-headers-3.0.0-13 and that sounds like the kind of package installation and removal handled by dist-upgrade, but not by upgrade.
edited Apr 5 '15 at 19:53
muru
133k19282481
133k19282481
answered Nov 22 '11 at 6:57
jcollado
6,92811723
6,92811723
4
I don't seefull-upgradeas an option toapt-getunder 14.04.1.
– nobar
May 16 '15 at 2:34
I didn't knew aboutapteither but it seems to be a completely diffrent command according to the man page he linked
– BlueWizard
Oct 20 '15 at 20:37
14
@nobar You don't see because it is an option ofaptand not ofapt-get... :-) Tryman apt.
– Hastur
Oct 29 '15 at 9:47
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
5
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
|
show 2 more comments
4
I don't seefull-upgradeas an option toapt-getunder 14.04.1.
– nobar
May 16 '15 at 2:34
I didn't knew aboutapteither but it seems to be a completely diffrent command according to the man page he linked
– BlueWizard
Oct 20 '15 at 20:37
14
@nobar You don't see because it is an option ofaptand not ofapt-get... :-) Tryman apt.
– Hastur
Oct 29 '15 at 9:47
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
5
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
4
4
I don't see
full-upgrade as an option to apt-get under 14.04.1.– nobar
May 16 '15 at 2:34
I don't see
full-upgrade as an option to apt-get under 14.04.1.– nobar
May 16 '15 at 2:34
I didn't knew about
apt either but it seems to be a completely diffrent command according to the man page he linked– BlueWizard
Oct 20 '15 at 20:37
I didn't knew about
apt either but it seems to be a completely diffrent command according to the man page he linked– BlueWizard
Oct 20 '15 at 20:37
14
14
@nobar You don't see because it is an option of
apt and not of apt-get... :-) Try man apt.– Hastur
Oct 29 '15 at 9:47
@nobar You don't see because it is an option of
apt and not of apt-get... :-) Try man apt.– Hastur
Oct 29 '15 at 9:47
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
Okay, I searched and the earliest link I found is for Ubuntu 15.10 (which came out end of 2014 which seams reasonable with Jessie testing) manpages.ubuntu.com/manpages/wily/en/man8/apt.8.html
– Z boson
Jan 24 '17 at 15:09
5
5
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
@Zboson Yeah, and 14.04 came out not in 2011, but in April 2014... see the pattern?
– tgies
May 18 '17 at 21:25
|
show 2 more comments
up vote
123
down vote
apt-get upgrade is restricted to the case where packages are to be replaced by newer versions, but no package needs to be added or removed. A new version of Firefox, for instance, should be installable with apt-get upgrade.
However apt-get upgrade will refuse to work when there are additions or removals required by the updated versions. For example, when you have kernel linux-image-3.2.0-10-generic installed and linux-image-3.2.0-11-generic appears, the linux-image-generic package gets updated to depend on the newer version. In order to install the new kernel, you need to run apt-get dist-upgrade.
Notice how an apt-get upgrade will say that the kernel packages have been held back. That's the cue for using apt-get dist-upgrade.
2
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
11
The graphical utility,update-manager, does not useapt-getdirectly; instead it works with a backend calledaptdaemon. The standard abilities ofupdate-managerare a mix of theupgradeanddist-upgrademodes ofapt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, useapt-get upgrade. If you see it reports that packages have been "held back", runapt-get dist-upgradeto pick up the remaining updates.
– pablomme
Jan 29 '12 at 2:10
add a comment |
up vote
123
down vote
apt-get upgrade is restricted to the case where packages are to be replaced by newer versions, but no package needs to be added or removed. A new version of Firefox, for instance, should be installable with apt-get upgrade.
However apt-get upgrade will refuse to work when there are additions or removals required by the updated versions. For example, when you have kernel linux-image-3.2.0-10-generic installed and linux-image-3.2.0-11-generic appears, the linux-image-generic package gets updated to depend on the newer version. In order to install the new kernel, you need to run apt-get dist-upgrade.
Notice how an apt-get upgrade will say that the kernel packages have been held back. That's the cue for using apt-get dist-upgrade.
2
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
11
The graphical utility,update-manager, does not useapt-getdirectly; instead it works with a backend calledaptdaemon. The standard abilities ofupdate-managerare a mix of theupgradeanddist-upgrademodes ofapt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, useapt-get upgrade. If you see it reports that packages have been "held back", runapt-get dist-upgradeto pick up the remaining updates.
– pablomme
Jan 29 '12 at 2:10
add a comment |
up vote
123
down vote
up vote
123
down vote
apt-get upgrade is restricted to the case where packages are to be replaced by newer versions, but no package needs to be added or removed. A new version of Firefox, for instance, should be installable with apt-get upgrade.
However apt-get upgrade will refuse to work when there are additions or removals required by the updated versions. For example, when you have kernel linux-image-3.2.0-10-generic installed and linux-image-3.2.0-11-generic appears, the linux-image-generic package gets updated to depend on the newer version. In order to install the new kernel, you need to run apt-get dist-upgrade.
Notice how an apt-get upgrade will say that the kernel packages have been held back. That's the cue for using apt-get dist-upgrade.
apt-get upgrade is restricted to the case where packages are to be replaced by newer versions, but no package needs to be added or removed. A new version of Firefox, for instance, should be installable with apt-get upgrade.
However apt-get upgrade will refuse to work when there are additions or removals required by the updated versions. For example, when you have kernel linux-image-3.2.0-10-generic installed and linux-image-3.2.0-11-generic appears, the linux-image-generic package gets updated to depend on the newer version. In order to install the new kernel, you need to run apt-get dist-upgrade.
Notice how an apt-get upgrade will say that the kernel packages have been held back. That's the cue for using apt-get dist-upgrade.
answered Jan 27 '12 at 16:34
pablomme
4,12021931
4,12021931
2
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
11
The graphical utility,update-manager, does not useapt-getdirectly; instead it works with a backend calledaptdaemon. The standard abilities ofupdate-managerare a mix of theupgradeanddist-upgrademodes ofapt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, useapt-get upgrade. If you see it reports that packages have been "held back", runapt-get dist-upgradeto pick up the remaining updates.
– pablomme
Jan 29 '12 at 2:10
add a comment |
2
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
11
The graphical utility,update-manager, does not useapt-getdirectly; instead it works with a backend calledaptdaemon. The standard abilities ofupdate-managerare a mix of theupgradeanddist-upgrademodes ofapt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, useapt-get upgrade. If you see it reports that packages have been "held back", runapt-get dist-upgradeto pick up the remaining updates.
– pablomme
Jan 29 '12 at 2:10
2
2
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
Perfect! :D Two more questions... what is used by the graphical update manager in Ubuntu? What is the recommended one?
– THpubs
Jan 29 '12 at 1:46
11
11
The graphical utility,
update-manager, does not use apt-get directly; instead it works with a backend called aptdaemon. The standard abilities of update-manager are a mix of the upgrade and dist-upgrade modes of apt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, use apt-get upgrade. If you see it reports that packages have been "held back", run apt-get dist-upgrade to pick up the remaining updates.– pablomme
Jan 29 '12 at 2:10
The graphical utility,
update-manager, does not use apt-get directly; instead it works with a backend called aptdaemon. The standard abilities of update-manager are a mix of the upgrade and dist-upgrade modes of apt-get: it can add but not remove packages - it invokes the "Partial upgrade" tool when removals are required. When using the command line, use apt-get upgrade. If you see it reports that packages have been "held back", run apt-get dist-upgrade to pick up the remaining updates.– pablomme
Jan 29 '12 at 2:10
add a comment |
up vote
33
down vote
Basically upgrade will only upgrade existing packages from one version to another. It will not install or remove packages, even if doing so is required to upgrade others. In the case of kernel updates, upgrading the linux-generic package requires installing the new linux-3.0.0-13-generic package, and since upgrade refuses to install or remove packages, it refuses to upgrade linux-generic.
Sometimes various incompatibilities between packages will require some packages to be removed in order to upgrade others, and that will also require dist-upgrade. Kernel updates will always require dist-upgrade because of how they are handled. Rather than have a kernel package that gets updated, an entirely new kernel package is created each time, and the kernel metapackage is updated to depend on the new kernel package instead of the old. This was done so that you keep the old kernel versions around so that in case there is a problem with booting the new kernel, you can choose the old one from the boot menu and recover.
2
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
add a comment |
up vote
33
down vote
Basically upgrade will only upgrade existing packages from one version to another. It will not install or remove packages, even if doing so is required to upgrade others. In the case of kernel updates, upgrading the linux-generic package requires installing the new linux-3.0.0-13-generic package, and since upgrade refuses to install or remove packages, it refuses to upgrade linux-generic.
Sometimes various incompatibilities between packages will require some packages to be removed in order to upgrade others, and that will also require dist-upgrade. Kernel updates will always require dist-upgrade because of how they are handled. Rather than have a kernel package that gets updated, an entirely new kernel package is created each time, and the kernel metapackage is updated to depend on the new kernel package instead of the old. This was done so that you keep the old kernel versions around so that in case there is a problem with booting the new kernel, you can choose the old one from the boot menu and recover.
2
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
add a comment |
up vote
33
down vote
up vote
33
down vote
Basically upgrade will only upgrade existing packages from one version to another. It will not install or remove packages, even if doing so is required to upgrade others. In the case of kernel updates, upgrading the linux-generic package requires installing the new linux-3.0.0-13-generic package, and since upgrade refuses to install or remove packages, it refuses to upgrade linux-generic.
Sometimes various incompatibilities between packages will require some packages to be removed in order to upgrade others, and that will also require dist-upgrade. Kernel updates will always require dist-upgrade because of how they are handled. Rather than have a kernel package that gets updated, an entirely new kernel package is created each time, and the kernel metapackage is updated to depend on the new kernel package instead of the old. This was done so that you keep the old kernel versions around so that in case there is a problem with booting the new kernel, you can choose the old one from the boot menu and recover.
Basically upgrade will only upgrade existing packages from one version to another. It will not install or remove packages, even if doing so is required to upgrade others. In the case of kernel updates, upgrading the linux-generic package requires installing the new linux-3.0.0-13-generic package, and since upgrade refuses to install or remove packages, it refuses to upgrade linux-generic.
Sometimes various incompatibilities between packages will require some packages to be removed in order to upgrade others, and that will also require dist-upgrade. Kernel updates will always require dist-upgrade because of how they are handled. Rather than have a kernel package that gets updated, an entirely new kernel package is created each time, and the kernel metapackage is updated to depend on the new kernel package instead of the old. This was done so that you keep the old kernel versions around so that in case there is a problem with booting the new kernel, you can choose the old one from the boot menu and recover.
answered Nov 22 '11 at 14:45
psusi
30.8k14886
30.8k14886
2
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
add a comment |
2
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
2
2
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
Best gist. Still, how to keep a certain package?
– 0xC0000022L
Nov 15 '13 at 17:06
add a comment |
up vote
11
down vote
The apt-get upgrade command will normally only install updates (or fixes) to currently installed packages. Typically a new release of Mozilla Firefox, for instance, would be installed with this command.
However apt-get upgrade will NOT generally install new releases, where major changes (including removal of packages or GRUB update is required). For example, when a new Linux kernel (linux-image-3.x.x-xx-generic, etc.) is available, the package will not get installed.
In order to install the new kernel, you will need to run apt-get dist-upgrade. You will be notified when you run apt-get upgrade, as it will say that certain packages have been held back. That's your cue to use: apt-get dist-upgrade.
11
This is misleading.dist-upgradewill not upgrade to a new release unlesssources.listhas been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed withdist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false.sudo apt-get upgradeis perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed.update-grubis run automatically, as always.
– Eliah Kagan
Apr 13 '13 at 2:11
2
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
2
Besides what Eliah mentioned, the essential point is thatapt-get upgradewill not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.
– Chan-Ho Suh
May 24 '13 at 3:19
1
Correction:apt-get upgradewill never install or remove any packages. Kernel upgrades are packaged as new packages and as a result,apt-get upgradewill never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference betweenupgradeanddist-upgrade.
– Mikko Rantalainen
Sep 19 '16 at 6:07
add a comment |
up vote
11
down vote
The apt-get upgrade command will normally only install updates (or fixes) to currently installed packages. Typically a new release of Mozilla Firefox, for instance, would be installed with this command.
However apt-get upgrade will NOT generally install new releases, where major changes (including removal of packages or GRUB update is required). For example, when a new Linux kernel (linux-image-3.x.x-xx-generic, etc.) is available, the package will not get installed.
In order to install the new kernel, you will need to run apt-get dist-upgrade. You will be notified when you run apt-get upgrade, as it will say that certain packages have been held back. That's your cue to use: apt-get dist-upgrade.
11
This is misleading.dist-upgradewill not upgrade to a new release unlesssources.listhas been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed withdist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false.sudo apt-get upgradeis perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed.update-grubis run automatically, as always.
– Eliah Kagan
Apr 13 '13 at 2:11
2
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
2
Besides what Eliah mentioned, the essential point is thatapt-get upgradewill not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.
– Chan-Ho Suh
May 24 '13 at 3:19
1
Correction:apt-get upgradewill never install or remove any packages. Kernel upgrades are packaged as new packages and as a result,apt-get upgradewill never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference betweenupgradeanddist-upgrade.
– Mikko Rantalainen
Sep 19 '16 at 6:07
add a comment |
up vote
11
down vote
up vote
11
down vote
The apt-get upgrade command will normally only install updates (or fixes) to currently installed packages. Typically a new release of Mozilla Firefox, for instance, would be installed with this command.
However apt-get upgrade will NOT generally install new releases, where major changes (including removal of packages or GRUB update is required). For example, when a new Linux kernel (linux-image-3.x.x-xx-generic, etc.) is available, the package will not get installed.
In order to install the new kernel, you will need to run apt-get dist-upgrade. You will be notified when you run apt-get upgrade, as it will say that certain packages have been held back. That's your cue to use: apt-get dist-upgrade.
The apt-get upgrade command will normally only install updates (or fixes) to currently installed packages. Typically a new release of Mozilla Firefox, for instance, would be installed with this command.
However apt-get upgrade will NOT generally install new releases, where major changes (including removal of packages or GRUB update is required). For example, when a new Linux kernel (linux-image-3.x.x-xx-generic, etc.) is available, the package will not get installed.
In order to install the new kernel, you will need to run apt-get dist-upgrade. You will be notified when you run apt-get upgrade, as it will say that certain packages have been held back. That's your cue to use: apt-get dist-upgrade.
edited Jun 13 '12 at 20:13
Bruno Pereira
59.1k26179204
59.1k26179204
answered Jan 28 '12 at 0:55
david6
13.6k43144
13.6k43144
11
This is misleading.dist-upgradewill not upgrade to a new release unlesssources.listhas been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed withdist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false.sudo apt-get upgradeis perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed.update-grubis run automatically, as always.
– Eliah Kagan
Apr 13 '13 at 2:11
2
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
2
Besides what Eliah mentioned, the essential point is thatapt-get upgradewill not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.
– Chan-Ho Suh
May 24 '13 at 3:19
1
Correction:apt-get upgradewill never install or remove any packages. Kernel upgrades are packaged as new packages and as a result,apt-get upgradewill never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference betweenupgradeanddist-upgrade.
– Mikko Rantalainen
Sep 19 '16 at 6:07
add a comment |
11
This is misleading.dist-upgradewill not upgrade to a new release unlesssources.listhas been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed withdist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false.sudo apt-get upgradeis perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed.update-grubis run automatically, as always.
– Eliah Kagan
Apr 13 '13 at 2:11
2
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
2
Besides what Eliah mentioned, the essential point is thatapt-get upgradewill not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.
– Chan-Ho Suh
May 24 '13 at 3:19
1
Correction:apt-get upgradewill never install or remove any packages. Kernel upgrades are packaged as new packages and as a result,apt-get upgradewill never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference betweenupgradeanddist-upgrade.
– Mikko Rantalainen
Sep 19 '16 at 6:07
11
11
This is misleading.
dist-upgrade will not upgrade to a new release unless sources.list has been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed with dist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false. sudo apt-get upgrade is perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed. update-grub is run automatically, as always.– Eliah Kagan
Apr 13 '13 at 2:11
This is misleading.
dist-upgrade will not upgrade to a new release unless sources.list has been modified accordingly (and even then, that's not a supported way to upgrade in Ubuntu). When a new kernel is installed with dist-upgrade, that's not a new release of Ubuntu. It's just a new package. Furthermore, the claim "or GRUB update is required" is false. sudo apt-get upgrade is perfectly capable of upgrading packages in a situation where GRUB must be updated, so long as no packages are removed and new packages are installed. update-grub is run automatically, as always.– Eliah Kagan
Apr 13 '13 at 2:11
2
2
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
You should write your own answer, as that add no clarity to mine.
– david6
Apr 13 '13 at 6:13
2
2
Besides what Eliah mentioned, the essential point is that
apt-get upgrade will not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.– Chan-Ho Suh
May 24 '13 at 3:19
Besides what Eliah mentioned, the essential point is that
apt-get upgrade will not remove or add packages. If a fix to a package requires a new package, the update will be held back. pablomme's answer, which you revised to be less accurate, is better and I'd advise readers to go to that one.– Chan-Ho Suh
May 24 '13 at 3:19
1
1
Correction:
apt-get upgrade will never install or remove any packages. Kernel upgrades are packaged as new packages and as a result, apt-get upgrade will never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference between upgrade and dist-upgrade.– Mikko Rantalainen
Sep 19 '16 at 6:07
Correction:
apt-get upgrade will never install or remove any packages. Kernel upgrades are packaged as new packages and as a result, apt-get upgrade will never upgrade the kernel. The fact that kernel upgrade does "major" changes such as GRUB configuration is not the reason for the difference between upgrade and dist-upgrade.– Mikko Rantalainen
Sep 19 '16 at 6:07
add a comment |
up vote
0
down vote
Your best option is:
apt full-upgrade
-which auto-handles the dependencies when upgrading packages; whereas:
apt upgrade
-does NOT auto-handle dependencies when upgrading packages.
-duBtrotterS
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
Your best option is:
apt full-upgrade
-which auto-handles the dependencies when upgrading packages; whereas:
apt upgrade
-does NOT auto-handle dependencies when upgrading packages.
-duBtrotterS
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
up vote
0
down vote
Your best option is:
apt full-upgrade
-which auto-handles the dependencies when upgrading packages; whereas:
apt upgrade
-does NOT auto-handle dependencies when upgrading packages.
-duBtrotterS
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Your best option is:
apt full-upgrade
-which auto-handles the dependencies when upgrading packages; whereas:
apt upgrade
-does NOT auto-handle dependencies when upgrading packages.
-duBtrotterS
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Nov 18 at 6:36
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Nov 18 at 4:51
Brett Maddox-Stroud
11
11
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Brett Maddox-Stroud is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f81585%2fwhat-is-dist-upgrade-and-why-does-it-upgrade-more-than-upgrade%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown