Skip to content

Instantly share code, notes, and snippets.

@gudezhi
Last active April 9, 2025 03:48
Show Gist options
  • Save gudezhi/f70e81dbb65e935bf7a89666e5195a1b to your computer and use it in GitHub Desktop.
Save gudezhi/f70e81dbb65e935bf7a89666e5195a1b to your computer and use it in GitHub Desktop.
winget

Winget 使用代理

命令行参数(单次使用) 1.开启配置(需要管理员权限)

winget settings --enable ProxyCommandLineOptions 2.使用

winget install Git.Git --proxy http://127.0.0.1:10809 使用管理员配置(不需要每次输入) 开启配置(需要管理员权限)

winget settings set DefaultProxy http://127.0.0.1:10809 关闭配置(需要管理员权限)

winget settings reset DefaultProxy

winget安装失败解决方案

winget使用任何命令都报错

尝试更新源失败: winget
打开预定义源失败; 请向 winget 维护人员报告。
执行此命令时发生意外错误:
0x80070005

Appx - Import-Module: Operation is not supported on this platform. (0x80131539)(PowerShell/PowerShell#13138) Winget is totally broken on my system(microsoft/winget-cli#4683)

import-module appx -usewindowspowershell

Get-AppxPackage -Name "*winget*"

Remove-AppxPackage -Package 'Microsoft.Winget.Source_2024.306.445.830_neutral__8wekyb3d8bbwe'

gsudo
winget source reset --force

导出导入

winget export winget.list.xxxx.txt

winget import -i list.txt --accept-package-agreements

winget install 7zip -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment