How do I update all Chocolatey applications without confirmation?
Asked Answered
T

2

77

I used to be able to call cup all and have my applications update. Now, it asks for yes to ensure that I want to install the selected package. Is there a way I can have everything auto update without constantly typing yes for every update?

Tergal answered 26/4, 2015 at 3:38 Comment(2)
Added a note in choco 0.9.9.6 when it prompts to mention how to autoconfirm specifically.Tumbleweed
how about choco update all -y?Sf
E
133

As Rob points out, -y will skip the prompts for a given command.

If you'd rather not be bothered with confirmation prompts at all, you can set the option globally.

The following enables allowGlobalConfirmation, which will install or update without confirmation prompts.

choco feature enable -n=allowGlobalConfirmation

If you ever want to turn the prompts back on, run the same command with disable:

choco feature disable -n=allowGlobalConfirmation

This can be useful for unattended scripts without affecting the future state of the prompts.

NOTE: The syntax has recently changed (July 2016) and now requires an equals sign before allowGlobalConfirmation instead of a dash. Thanks for the heads up, @dragon788.

Eveland answered 24/5, 2015 at 20:49 Comment(3)
Thanks Jon, probably should have made that stand out more in my answer.Tumbleweed
I think between the two answers, people will both learn to fish and eat the fish. BTW @ferventcoder, thanks a bunch for chocolatey -- I'm a huge fan.Eveland
this should have been the answer.Trematode
T
60

tl;dr - Yes, completely possible. Use choco upgrade all -y

Also check out the help menus now - choco -h, choco install -h

Longer answer, we've moved a little closer towards other package managers for security reasons, where by default we stop and confirm if you are okay with the state change. I always communicate changes in the release notes / changelog, which also end up in the nuspec file, so I highly recommend folks scan at least one of those to see anything tagged breaking changes. Always scan from your current version up to the one you are upgrading to so that you catch all changes.

The one that is the most important right now is the x.y.z release (in this case 0.9.9), once we reach v1 we will be fully SemVer compliant and breaking changes will constitute a major version bump (we're still semver in a less than v1), so you can scan breaking changes and major new features in an x release, new compatible features in a .y release, and .z releases will only contain compatible fixes for the current release.

0.9.9 introduced a new compiled client that was/is a total rewrite. 0.9.10 will have complete feature parity with the older client - see FeatureParity. Why the rewrite? For a more maintainable, faster client that can run on mono now, so you are not completely tied to Windows. We've started adding support for other install providers (like Scriptcs).

The relevant bits of the release notes for your question:

  • [Security] Prompt for confirmation: For security reasons, we now stop for confirmation before changing the state of the system on most commands. You can pass -y to confirm any prompts or set a value in the config that will globally confirm and behave like older versions of Chocolatey (allowGlobalConfirmation, see choco feature -h for how to enable).
Tumbleweed answered 26/4, 2015 at 12:21 Comment(2)
did not work for me on windows 11Papistry
@MiguelTomás the command is now choco upgrade all -y. I want to say cup has been deprecated in v1 and removed in v2 (which has alpha versions available as of the date of this comment).Tumbleweed

© 2022 - 2024 — McMap. All rights reserved.