How do I update all Chocolatey applications without confirmation?

a 夏天 提交于 2019-11-28 18:17:07

问题


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?


回答1:


tl;dr - Yes, completely possible. Use cup 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).



回答2:


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.



来源:https://stackoverflow.com/questions/29873439/how-do-i-update-all-chocolatey-applications-without-confirmation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!