salt icon indicating copy to clipboard operation
salt copied to clipboard

Consider dist-upgrade instead of upgrade for apt

Open djs52 opened this issue 14 years ago • 4 comments

On my system currently,

djs-admin@thames:~$ apt-get --just-print upgrade
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have been kept back:
  linux-headers-generic linux-image-generic
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

which means that salt doesn't list the kernel as being upgradable:

djs-admin@thames:~$ sudo salt 'thames*' pkg.list_upgrades
{'thames.office.adelard.com': {}}

If I use dist-upgrade, a full list of upgrades is shown:

djs-admin@thames:~$ apt-get --just-print dist-upgrade
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed
  linux-headers-3.2.0-25 linux-headers-3.2.0-25-generic linux-image-3.2.0-25-generic
The following packages will be upgraded:
  linux-headers-generic linux-image-generic
2 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Inst linux-image-3.2.0-25-generic (3.2.0-25.40 Ubuntu:12.04/precise-updates [i386])
Inst linux-headers-3.2.0-25 (3.2.0-25.40 Ubuntu:12.04/precise-updates [all])
Inst linux-headers-3.2.0-25-generic (3.2.0-25.40 Ubuntu:12.04/precise-updates [i386])
Inst linux-headers-generic [3.2.0.24.26] (3.2.0.25.27 Ubuntu:12.04/precise-updates [i386])
Inst linux-image-generic [3.2.0.24.26] (3.2.0.25.27 Ubuntu:12.04/precise-updates [i386])
Conf linux-image-3.2.0-25-generic (3.2.0-25.40 Ubuntu:12.04/precise-updates [i386])
Conf linux-headers-3.2.0-25 (3.2.0-25.40 Ubuntu:12.04/precise-updates [all])
Conf linux-headers-3.2.0-25-generic (3.2.0-25.40 Ubuntu:12.04/precise-updates [i386])
Conf linux-headers-generic (3.2.0.25.27 Ubuntu:12.04/precise-updates [i386])
Conf linux-image-generic (3.2.0.25.27 Ubuntu:12.04/precise-updates [i386])

I can see an argument for not showing dist-upgrades by default, but it might be useful to have it available as an option.

djs52 avatar Jun 18 '12 11:06 djs52

I think that I agree with you. But I would like some feedback from the Debian users here since I am not as heavy of a Debian user.

thatch45 avatar Jun 18 '12 14:06 thatch45

In general you want to do dist-upgrade rather than upgrade, since dist-upgrade also figures out if dependencies have changed and some other magic. From apt-get manpage:

   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.

drzero42 avatar Jun 18 '12 15:06 drzero42

https://github.com/saltstack/salt/blob/develop/salt/modules/apt.py#L244 Looks like it is calling dist-upgrade to me, are we missing something here?

thatch45 avatar Jun 25 '12 15:06 thatch45

nm, I see the issue, gimme a minute

thatch45 avatar Jun 25 '12 15:06 thatch45