Windows 10 使用Chocolatey包管理器(类似yum和brew)

/ 0评 / 0

一直在Mac和CentOS下使用包管理器,习惯了,在Windows上面就及其痛苦,因为要安装一个包或者库的时候(动态库)需要手动编译。搜索发现 Chocolatey 这个包管理器,下面是安装过程:

打开Powershell工具, 输入:Get-ExecutionPolicy,如果返回 Restricted,继续输入 Set-ExecutionPolicy AllSigned ,然后输入以下指令自动安装:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

安装成功以后,可以搜索、安装相应的软件,如:

// 搜索某个软件包
choco search imagemagick

// 安装某个软件包
choco install -y imagemagick

Chocolatey 安装软件默认就在 系统盘\ Program Files 目录下,而且安装成功后会自动将二进制路径添加到系统环境变量中,可以在Powershell中执行对应的指令

名言语句:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注