Window下开发环境安装教程

Window包管理工具Chocolatey安装

一个能让你在Window下体验Linux apt/yum类似一键安装开发环境的包管理器。
官网地址 https://chocolatey.org/

安装要求

  • Windows 7+ / Windows Server 2003+
  • PowerShell v2+ (Not PowerShell Core yet though)
  • .NET Framework 4+ (the installation will attempt to install .NET 4.0 if you do not have it installed)

使用cmd.exe安装

1
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

使用PowerShell.exe安装

1
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

运行

choco
查看帮助来获取更多信息,基本命令: search, install, upgrade, uninstall
比如,安装svn

  1. 以管理员身份运行命令行并输入:choco search svn

    1
    2
    3
    4
    > choco search svn
    Chocolatey v0.10.15
    svn 1.8.17 [Approved] Downloads cached for licensed users
    tortoisesvn 1.12.2.28653 [Approved]
  2. 选择安装tortoisesvn, choco install tortoisesvn -y

更新Chocolatey

choco upgrade chocolatey

查看过期并更新

choco outdated

1
2
3
4
5
6
7
8
λ choco outdated
Chocolatey v0.10.15
Outdated Packages
Output is package name | current version | available version | pinned?

python3|3.7.3|3.7.4|false

Chocolatey has determined 1 package(s) are outdated.