windows server 2022安装winget方法

windows server 2022安装winget方法

缘起

公司开始逐渐要求使用云电脑办公了,云电脑主流的都是server系统,且版本不高。

只有新版本的 11+ 及 Server 2025+ 会自带winget,所以需要在老版本上安装winget。

方法

winget微软开源了,地址:

https://github.com/microsoft/winget-cli/

至少需要下载如下3个文件:

安装

  1. 先顺序安装这三个:

解压DesktopAppInstaller_Dependencies.zip后,打开x64文件夹:

安装脚本:

启动powershell

bash 复制代码
Import-Module -Name Appx -UseWindowsPowerShell

Add-AppxPackage Microsoft.VCLibs.140.00_14.0.33519.0_x64.appx
Add-AppxPackage Microsoft.VCLibs.140.00.UWPDesktop_14.0.33728.0_x64.appx
Add-AppxPackage Microsoft.WindowsAppRuntime.1.8_8000.616.304.0_x64.appx
  1. 安装msixbundle
bash 复制代码
Add-AppxProvisionedPackage -Online -PackagePath .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle -LicensePath .\e53e159d00e04f729cc2180cffd1c02e_License1.xml

基本设置

winget使用github来存储的,所以必须要安装的是git

bash 复制代码
winget install Git.Git

安装windows最好用的terminal:

bash 复制代码
winget install Microsoft.WindowsTerminal

安装微软的linux工具集

bash 复制代码
winget install Microsoft.Coreutils

这个工具集专门介绍过:

微软把Linux命令搬进Win11:Coreutils开源项目重磅发布

镜像修改

大家网络环境都不是太好,用国内镜像比较好:

bash 复制代码
# 替换 USTC 镜像
winget source remove winget
winget source add winget https://mirrors.ustc.edu.cn/winget-source

# 重置为官方地址
winget source reset winget

其他安装方法

鉴于低版本系统安装的不方便,还是有大佬总结了一键脚本的:

部署 WinGet 的 PS 脚本到 PowerShell Gallery 仓库

详细减少可以看github:https://gist.github.com/erwinkersten/626ed456c1bd84fd5e023b081d6d450e

使用方法:

bash 复制代码
Install-Script -Name winget-install
winget-install -Force

这个脚本只是将手工安装自动化了,还是需要网络环境的,我试了失败,才手工安装的,网络好的可以试试

小结

其实windows对应程序员来说,也没必mac差的那么不堪,自己折腾折腾还是可以的。

欢迎关注:

windows server 2022安装winget方法

相关推荐
Funlang21 小时前
在 Windows NT 3.5 上跑 Fun
windows
xx z2 天前
directx修复工具下载(DirectX Repair 增强版 使用说明)
windows·系统·工具·软件
xx z2 天前
pcl2启动器下载(Minecraft PCL2 启动器 最新版 安装与使用说明)
windows·游戏·工具·软件
凯瑟琳.奥古斯特2 天前
我开源了一个 Windows 截图取字工具:全局热键 + 离线 OCR + 标注打码,不上传任何数据
windows·ocr
Funlang3 天前
在 Windows 95 上跑 Fun
windows
ö Constancy3 天前
一台电脑的硬件组成与作用:按功能分类详解(Windows 与 Linux 视角)
linux·windows·电脑
雪落漂泊4 天前
Liunux进程(七):程序控制篇(中)
linux·运维·windows
承渊政道5 天前
Fooocus本地AI绘图教程:Windows部署、低门槛生图与远程访问
人工智能·windows·cpolar·fooocus·生图
陈工大模型5 天前
收到乱码压缩包之后,我重新测了 7-Zip、Bandizip 和win解压缩
windows·电脑·软件工程·软件需求·7-zip
谙弆悕博士5 天前
在文件夹右键直接打开 Kali WSL:一条 `wsl --cd` 注册表脚本
windows·脚本·wsl·右击·ksli