Mani interesēja, kāpēc upgrade
dažreiz nevēlas atjaunināt noteiktas sistēmas daļas, bet dist-upgrade
to dara. Lūk, piemērs pēc apt-get upgrade
palaišanas:
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.
pret 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]?
Citiem vārdiem sakot, kāpēc to nevar veikt ar upgrade
?
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.
Un ar jaunāku apt
rīku, kas pieejams, sākot ar 14.04. versiju:
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.
Jūsu konkrētajā gadījumā es redzu, ka, piemēram, linux-headers
ir virtuāla pakete, ko nodrošina gan linux-headers-3.0.0-12
, gan linux-headers-3.0.0-13
, un tas izklausās pēc paketes instalēšanas un noņemšanas, ko veic dist-upgrade
, bet ne upgrade
.
apt-get upgrade
attiecas tikai uz gadījumiem, kad paketes jāaizstāj ar jaunākām versijām, bet paketes nav nepieciešams pievienot vai noņemt. Piemēram, ar apt-get upgrade
vajadzētu instalēt jaunu Firefox versiju.
Tomēr apt-get upgrade
atteiksies darboties, ja atjauninātajām versijām būs nepieciešams pievienot vai noņemt kādu no tām. Piemēram, ja ir instalēts kodola linux-image-3.2.0-10-generic
un parādās linux-image-3.2.0-11-generic
, linux-image-generic
pakete tiek atjaunināta, lai būtu atkarīga no jaunākās versijas. Lai instalētu jauno kodolu, ir jāpalaiž apt-get dist-upgrade
.
Ievērojiet, ka apt-get upgrade
paziņos, ka kodola paketes ir aizturētas
. Tas ir norādījums, lai izmantotu apt-get dist-upgrade
.
Būtībā jaunināšana atjauninās tikai esošās paketes no vienas versijas uz citu. Tas neinstalēs vai neizdzēsīs paketes, pat ja tas ir nepieciešams, lai atjauninātu citas. Kodola atjauninājumu gadījumā linux-generic pakotnes atjaunināšanai ir nepieciešams instalēt jauno linux-3.0.0-13-generic pakotni, un, tā kā jauninājums atsakās instalēt vai noņemt paketes, tas atsakās atjaunināt linux-generic.
Dažreiz dažādu paku nesaderību dēļ dažas pakas ir jādzēš, lai varētu atjaunināt citas, un tas arī prasa dist-upgrade. Kodola atjauninājumiem vienmēr būs nepieciešama dist-upgrade, jo tie tiek apstrādāti. Tā vietā, lai kodola pakete tiktu atjaunināta, katru reizi tiek radīta pilnīgi jauna kodola pakete, un kodola metapakete tiek atjaunināta, lai tā būtu atkarīga no jaunās kodola paketes, nevis no vecās. Tas tika darīts, lai saglabātu vecās kodola versijas, lai gadījumā, ja rodas problēmas ar jaunā kodola palaišanu, no palaišanas izvēlnes varētu izvēlēties veco kodola versiju un atgūties.