Windows Package Manager Chocolatey: a command to install software
This article Original Address: https://sitoi.cn/posts/46278.html
Introduction
Chocolatey is a software management solution that anything else you have experienced on Windows are not the same. It focuses on simplicity, security and scalability. You can write in PowerShell is any software (not just the installer) a software deployment, and can be used in any management system (configuration management, endpoint management, etc.) and track and manage the software update solution, deploy it to anywhere Windows is located. Over time. Chocolatey use locally, "cloud" or Docker container management software.
In short it: that is apt similar Liunx under, yum, dnf, etc. Package Manager.
Also to be noted that, Chocolatey just put the official download path package to Chocolatey in, so the download source is the official route, so the download must be legal, but if the original software is required Licence registered, then Chocolatey download and install good you need to buy software or register. But Chocolatey will choose general or free Licence available software.
Installation Requirements
- Windows 7+ / Windows Server 2003+
- PowerShell v2+
- .NET Framework 4+ (the installation will attempt to install .NET 4.0 if you do not have it installed)
Installation Chocolatey
Open PowerShell as an administrator of
右击
The lower left cornerWindows 图标
, selectWindows PowerShell(管理员)(A)
Enter the install command to install Chocolatey
- PowerShell code input terminal is mounted below the transport can enter:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- Wait for the installation to complete (if time does not reflect, try to open science Internet )
Detecting whether the installation is successful
- In PowerShell input terminal
choco
orchoco -?
detects whether the installation is successful
The installation was successful Get started today!
Choco install software
For example to install nodejs
Find Package
First, use the command to find package choco
In the terminal input choco search command:
choco search nodejs
Second, look for packages using the web client
Login choco package website: https://chocolatey.org/packages
In the search box to search for software to be installed
Installation package
In order to install the input terminal PowerShell
choco install nodejs
Command to download the installation package and then execute the installation script, after the download is complete, you will ask 是否希望运行安装脚本?
, input Y
can be.
Nodejs detecting whether the installation is successful, the input terminal node -v
When you want to install python, just:
choco install python
I want to install git, just:
choco install git
Want to install java, you need only:
choco install java
Choco common commands use
Chocolatey is also very simple, using the following command:
choco search <keyword> # 搜索软件
choco list <keyword> # 跟 search 命令功能类似
choco install <package1 package2 ...> # 安装软件
choco install <package> -version *** # 安装指定版本
choco uninstall name # 卸载软件
choco version <package> # 查看安装包的版本情况
choco upgrade <package> # 更新某个软件
choco list -localonly # 查看一下所有安装在本地的包的列表
choco list -lo # 功能同上
Type of bag
Chocolatey packages have different types, the name of the package which will include some special suffix, such as .install, .commandline, .portable, some names package without those suffixes.
No suffix (Example: nodejs, git)
.install (例:nodejs.install,git.install)
.install suffix package, which appears in the System control panel inside the Uninstall or change a program, you can put a package .install want to be by the installer (msi) installation package.
.commandline (example: nodejs.commandline, the future will be abandoned)
.commandline (in the future will be discarded) and .portable suffix package is a compressed (zip), this installation package suffix, you can not find them in the Uninstall or change a program.
.portable (例:putty.portable)
You can also choose a package without the suffix, so that if the system has been installed this package, it will jump over, if not installed, Chocolatey will install one for you, the default installation of this type of package should be the suffix of .install package.
Recommended order of packages: No suffix> .install> .portable> .commandline