Windows包管理 - choco、scoop

关闭Win10自带的Python别名

  1. 设置
  2. 应用
  3. 应用和功能
  4. 应用执行别名
  5. python.exepython3.exe关掉
  6. 检查explorer %USERPROFILE%\AppData\Local\Microsoft\WindowsApps

scoop

scoop可以安装在D盘之类的地方,目前主要使用这个

安装

$env:SCOOP='D:\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP',$env:SCOOP,'Machine')
$env:SCOOP_GLOBAL='D:\ScoopGlobalApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL',$env:SCOOP_GLOBAL,'Machine')


Set-ExecutionPolicy RemoteSigned -scope CurrentUser

# github 需要代理
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# 或者
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
scoop bucket add extras
scoop bucket add versions


## 
iwr -useb raw.fastgit.org/ScoopInstaller/Scoop/master/bin/install.ps1 | iex
## 国内安装
# gitee
iwr -useb gitee.com/glsnames/scoop-installer/raw/master/bin/install.ps1 | iex

scoop bucket rm main
scoop bucket add scoopMain https://gitee.com/glsnames/scoop-main.git
scoop bucket add my-bucket https://gitee.com/huyuwei/my-bucket.git

基础配置

scoop config SCOOP_REPO https://gitee.com/glsnames/scoop-installer
scoop update
scoop bucket add my-bucket https://gitee.com/huyuwei/my-bucket.git


scoop install 7zip aria2

scoop config aria2-max-connection-per-server 16
scoop config aria2-split 16
scoop config aria2-min-split-size 1M
scoop config aria2-warning-enabled false
scoop config aria2-enabled true

开启/关闭aria2加速

scoop config aria2-enabled false
scoop bucket add main https://github.com/ScoopInstaller/Main.git
scoop bucket add java https://github.com/ScoopInstaller/Java.git
scoop bucket add php https://github.com/ScoopInstaller/PHP.git
scoop bucket add versions https://github.com/ScoopInstaller/Versions.git
scoop bucket add extras https://github.com/lukesampson/scoop-extras.git

chocolaty

安装

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
rem cmd下运行
rem 拷贝目录
XCOPY C:\ProgramData\chocolatey D:\chocolatey
rem 系统环境变量
SETX /M ChocolateyInstall D:\chocolatey

gsudo安装

# github
PowerShell -Command "Set-ExecutionPolicy RemoteSigned -scope Process; iwr -useb https://raw.githubusercontent.com/gerardog/gsudo/master/installgsudo.ps1 | iex"
# gitee
PowerShell -Command "Set-ExecutionPolicy RemoteSigned -scope Process; iwr -useb https://gitee.com/joker_gitee/gsudo/raw/master/installgsudo.ps1 | iex"