windows下使用chocolatey安装程序


简介

Chocolatey is a software management solution unlike anything else you've ever experienced on Windows. Chocolatey brings the concepts of true package management to allow you to version things, manage dependencies and installation order, better inventory management, and other features.

安装

参考install-from-powershell-v3

install from PowerShell v3+

With PowerShell, there is an additional step or two. You must ensure Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.

Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass.
Now run the following command:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex

复制命令并安装

重启 powershell 检查安装

命令

This is a listing of all of the different things you can pass to choco.

  • list - lists remote or local packages
  • search - searches remote or local packages (alias for list)
  • info - retrieves package information. Shorthand for choco search pkgname --exact --verbose
  • install - installs packages from various sources
  • pin - suppress upgrades for a package
  • outdated - retrieves packages that are outdated. Similar to upgrade all --noop
  • upgrade - upgrades packages from various sources
  • uninstall - uninstalls a package
  • pack - packages up a nuspec to a compiled nupkg
  • push - pushes a compiled nupkg
  • new - generates files necessary for a chocolatey package from a template
  • sources - view and configure default sources (alias for source)
  • source - view and configure default sources
  • config - Retrieve and configure config file settings
  • feature - view and configure choco features
  • features - view and configure choco features (alias for feature)
  • setapikey - retrieves or saves an apikey for a particular source (alias for apikey)
  • apikey - retrieves or saves an apikey for a particular source
  • unpackself - have chocolatey set itself up
  • version - [DEPRECATED] will be removed in v1 - use choco outdated or cup <pkg|all> -whatif instead
  • update - [DEPRECATED] RESERVED for future use (you are looking for upgrade, these are not the droids you are looking for)
  • support - provides support information
  • download - downloads packages - optionally internalizing all remote resources
  • synchronize - synchronizes against system installed software - generates missing packages
  • sync - synchronizes against system installed software - generates missing packages
  • optimize - optimizes installation, reducing space usage

Please run chocolatey with choco command -help for specific help on
each command.

测试安装

安装cmake

  • 分享:
评论
还没有评论
    发表评论 说点什么