Wie aktualisiere ich alle Chocolatey-Pakete außer einem?


28

cup all -ywird verwendet, um alle Chocolatey- Pakete beim Booten zu aktualisieren . Im Moment gibt es ein Problem in der neuesten Version von VirtualBox, und ich möchte vermeiden, dass dieses Paket beim Booten aktualisiert wird, während die anderen Pakete aktualisiert werden müssen.

Versuchen Sie, das Problem zu lösen

Ich habe die Hilfefunktion des Befehls überprüft:

C:\>cup all -h
Chocolatey v0.9.9.8
Upgrade Command

Upgrades a package or a list of packages. Some may prefer to use `cup`
 as a shortcut for `choco upgrade`.

Usage

    choco upgrade <pkg|all> [<pkg2> <pkgN>] [<options/switches>]
    cup <pkg|all> [<pkg2> <pkgN>] [<options/switches>]

NOTE: `all` is a special package keyword that will allow you to upgrade
 all currently installed packages.

Examples

    choco upgrade chocolatey
    choco upgrade notepadplusplus googlechrome atom 7zip
    choco upgrade notepadplusplus googlechrome atom 7zip -dvfy
    choco upgrade git --params="/GitAndUnixToolsOnPath /NoAutoCrlf" -y
    choco upgrade nodejs.install --version 0.10.35
    choco upgrade git -s "https://somewhere/out/there"
    choco upgrade git -s "https://somewhere/protected" -u user -p pass

Options and Switches

NOTE: Options and switches apply to all items passed, so if you are
 installing multiple packages, and you use `--version=1.0.0`, it is
 going to look for and try to install version 1.0.0 of every package
 passed. So please split out multiple package calls when wanting to
 pass specific options.


 -?, --help, -h
     Prints out the help menu.

 -d, --debug
     Debug - Run in Debug Mode.

 -v, --verbose
     Verbose - See verbose messaging.

     --acceptlicense, --accept-license
     AcceptLicense - Accept license dialogs automatically.

 -y, --yes, --confirm
     Confirm all prompts - Chooses affirmative answer instead of prompting.
       Implies --accept-license

 -f, --force
     Force - force the behavior

     --noop, --whatif, --what-if
     NoOp - Don't actually do anything.

 -r, --limitoutput, --limit-output
     LimitOutput - Limit the output to essential information

     --execution-timeout=VALUE
     CommandExecutionTimeoutSeconds - Override the default execution timeout
       in the configuration of 2700 seconds.

 -c, --cache, --cachelocation, --cache-location=VALUE
     CacheLocation - Location for download cache, defaults to %TEMP% or value
       in chocolatey.config file.

     --allowunofficial, --allow-unofficial, --allowunofficialbuild, --allow-unofficial-build
     AllowUnofficialBuild - When not using the official build you must set
       this flag for choco to continue.

 -s, --source=VALUE
     Source - The source to find the package(s) to install. Special sources
       include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to
       default feeds.

     --version=VALUE
     Version - A specific version to install. Defaults to unspecified.

     --pre, --prerelease
     Prerelease - Include Prereleases? Defaults to false.

     --x86, --forcex86
     ForceX86 - Force x86 (32bit) installation on 64 bit systems. Defaults to
       false.

     --ia, --installargs, --installarguments, --install-arguments=VALUE
     InstallArguments - Install Arguments to pass to the native installer in
       the package. Defaults to unspecified.

 -o, --override, --overrideargs, --overridearguments, --override-arguments
     OverrideArguments - Should install arguments be used exclusively without
       appending to current package passed arguments? Defaults to false.

     --notsilent, --not-silent
     NotSilent - Do not install this silently. Defaults to false.

     --params, --parameters, --pkgparameters, --packageparameters, --package-parameters=VALUE
     PackageParameters - Parameters to pass to the package. Defaults to
       unspecified.

 -m, --sxs, --sidebyside, --side-by-side, --allowmultiple, --allow-multiple, --allowmultipleversions, --allow-multiple-versions
     AllowMultipleVersions - Should multiple versions of a package be
       installed? Defaults to false.

 -i, --ignoredependencies, --ignore-dependencies
     IgnoreDependencies - Ignore dependencies when upgrading package(s).
       Defaults to false.

 -n, --skippowershell, --skip-powershell
     Skip Powershell - Do not run chocolateyInstall.ps1. Defaults to false.

     --failonunfound, --fail-on-unfound
     Fail On Unfound Packages - If a package is not found in feeds specified,
       fail instead of warn.

     --failonnotinstalled, --fail-on-not-installed
     Fail On Non-installed Packages - If a package is not already intalled,
       fail instead of installing.

 -u, --user=VALUE
     User - used with authenticated feeds. Defaults to empty.

 -p, --password=VALUE
     Password - the user's password to the source. Defaults to empty.

Es scheint jedoch keine Funktion zum Ausschließen eines bestimmten Pakets zu haben.

Wie aktualisiere ich alle Pakete beim Booten, außer einem?

Antworten:


33

Sie haben zwei Möglichkeiten: Fixieren Sie ein Paket im Voraus oder schließen Sie Elemente währenddessen aus choco upgrade.

Anheften von Paketen zur Unterdrückung von Upgrades

Sie können jedes Programm anheften, das nicht aktualisiert werden soll.

Geben Sie choco pin -hfür weitere Details. Wenn dieser Befehl nichts bringt, aktualisieren Sie Chocolatey bitte auf mindestens 0.9.9.x.

Pin-Befehl

Pin ein Paket, um Upgrades zu unterdrücken.

Dies ist besonders hilfreich, wenn Sie choco upgradefür alle Pakete ausführen, da diese Pakete automatisch übersprungen werden. Eine andere Alternative ist choco upgrade --except="pkg1,pk2".

Verwendung

choco pin [list]|add|remove [<options/switches>]

Beispiele

choco pin
choco pin list
choco pin add -n=git
choco pin add -n=git --version 1.2.3
C4B: choco pin add -n=git --version 1.2.3 --reason "'others may need to review'"
choco pin remove --name git

HINWEIS : --reasonOption NUR in Chocolatey for Business (C4B) verfügbar.

Ausschließen von Paketen während des Upgrades

Manchmal möchten Sie einfach nur Elemente ausschließen, die normalerweise in Upgrades enthalten sind. Sie möchten keine Pins, da diese länger als eine einzelne Befehlsausführung leben sollen. Hier kommt die ExcludeOption für Ihren Upgrade-Befehl ins Spiel.

Ab Chocolatey v0.9.10 können Sie beim Aufrufen des Upgrades den optionalen --exceptSchalter für das Upgrade übergeben. Ein Beispiel wäre choco upgrade all --except="'conemu'".


Warum choco pin? Ist cup allveraltet?
030

9
Warum würde Tasse alle veraltet sein? Pin ist ein Befehl mit der Aufschrift "Bleib bei dieser Version für dieses Paket."
ferventcoder

HINWEIS: Um einer Stecknadel einen Grund hinzuzufügen, muss Chocolatey for Business (C4B) vorhanden sein.
ferventcoder

2

Laut der offiziellen Dokumentation :

choco upgrade all --except="'skype,conemu'"

Unter Windows verhindert dies, dass das Paket weiter aktualisiert wird, auch wenn Sie except nicht verwenden! Der Paketordner wird in verschoben C:\ProgramData\chocolatey\lib-bad. Wenn Sie erneut aktualisieren möchten, verschieben Sie es aufC:\ProgramData\chocolatey\lib
Alireza Fattahi
Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.