MCPcopy Create free account
hub / github.com/saltstack/salt / upgrade

Function upgrade

salt/modules/aptpkg.py:1086–1190  ·  view source on GitHub ↗

.. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 On minions running systemd>=205, `systemd-run(1)`_ is now used to isolate commands which modify installed packages from the ``salt-minion`` daemon's control group. This is done to keep systemd from killing any apt-

(refresh=True, dist_upgrade=False, **kwargs)

Source from the content-addressed store, hash-verified

1084
1085
1086def upgrade(refresh=True, dist_upgrade=False, **kwargs):
1087 """
1088 .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0
1089 On minions running systemd>=205, `systemd-run(1)`_ is now used to
1090 isolate commands which modify installed packages from the
1091 ``salt-minion`` daemon's control group. This is done to keep systemd
1092 from killing any apt-get/dpkg commands spawned by Salt when the
1093 ``salt-minion`` service is restarted. (see ``KillMode`` in the
1094 `systemd.kill(5)`_ manpage for more information). If desired, usage of
1095 `systemd-run(1)`_ can be suppressed by setting a :mod:`config option
1096 <salt.modules.config.get>` called ``systemd.scope``, with a value of
1097 ``False`` (no quotes).
1098
1099 .. _`systemd-run(1)`: https://www.freedesktop.org/software/systemd/man/systemd-run.html
1100 .. _`systemd.kill(5)`: https://www.freedesktop.org/software/systemd/man/systemd.kill.html
1101
1102 Upgrades all packages via ``apt-get upgrade`` or ``apt-get dist-upgrade``
1103 if ``dist_upgrade`` is ``True``.
1104
1105 Returns a dictionary containing the changes:
1106
1107 .. code-block:: python
1108
1109 {'<package>': {'old': '<old-version>',
1110 'new': '<new-version>'}}
1111
1112 dist_upgrade
1113 Whether to perform the upgrade using dist-upgrade vs upgrade. Default
1114 is to use upgrade.
1115
1116 .. versionadded:: 2014.7.0
1117
1118 refresh : True
1119 If ``True``, the apt cache will be refreshed first. By default,
1120 this is ``True`` and a refresh is performed.
1121
1122 cache_valid_time
1123
1124 .. versionadded:: 2016.11.0
1125
1126 Skip refreshing the package database if refresh has already occurred within
1127 <value> seconds
1128
1129 download_only (or downloadonly)
1130 Only download the packages, don&#x27;t unpack or install them. Use
1131 downloadonly to be in line with yum and zypper module.
1132
1133 .. versionadded:: 2018.3.0
1134
1135 force_conf_new
1136 Always install the new version of any configuration files.
1137
1138 .. versionadded:: 2015.8.0
1139
1140 allow_downgrades
1141 Allow apt to downgrade packages without a prompt.
1142
1143 .. versionadded:: 3005

Callers

nothing calls this directly

Calls 8

_call_aptFunction · 0.85
refresh_dbFunction · 0.70
list_pkgsFunction · 0.70
popMethod · 0.45
appendMethod · 0.45
getMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected