choco安装vcredist140报错Unable to resolve dependency ‘chocolatey-core.extension‘神走位修复方案

现象

执行下面的命令安装vcredist140

# 安装Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Start-Sleep -s 30
choco

# 安装vcredist140
choco install --accept-license -y vcredist140

报错信息如下:

PS C:\Windows\system32> choco install --accept-license -y vcredist140 -s 'https://community.chocolatey.org/api/v2/'
Chocolatey v2.2.2
Installing the following packages:
vcredist140
By installing, you accept licenses for the packages.
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='chocolatey-core.extension'&$skiptoken='1712192601110','1.0.1','chocolatey-core.extension'' with following message : An error occurred while sending the request.
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='kb3033929'&$skiptoken='1712096301283','1.0.0','kb3033929'' with following message : An error occurred while sending the request.
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='kb2919355'&$skiptoken='1712245703703','1.0.20160719','kb2919355'' with following message : An error occurred while sending the request.
Failed to fetch results from V2 feed at 'http://community.chocolatey.org/api/v2/FindPackagesById?id='kb2999226'&$skiptoken='1711612100460','1.0.20161030','kb2999226'' with following message : An error occurred while sending the request.
Unable to resolve dependency 'chocolatey-core.extension'. Source(s) used: 'https://community.chocolatey.org/api/v2/'.

解决方法

尝试过choco install --accept-license --force chocolatey-core.extension 安装缺失依赖包仍然不成功
只好添加--ignore-dependencies 或者-i参数绕过chocolatey-core.extension依赖
命令如下:

# 可以通过-s 参数指定源
choco install --accept-license -y vcredist140 --ignore-dependencies -s 'https://chocolatey.org/api/v2/'

其他方法,缺啥装啥

可以通过报错信息给的缺失依赖依次手动安装
例如:

# 安装vcredist140,只需要chocolatey-core.extension可以将后面的包去掉
choco install --accept-license  -y --pre kb2919442 KB2919355 chocolatey-compatibility.extension  chocolatey-core.extension  chocolatey-windowsupdate.extension  kb3035131 kb3033929  kb2999226  vcredist140
# 安装 7z
choco install --accept-license  -y --pre 7zip.install 7zip
# 安装 openjdk17
choco install --accept-license  -y --pre temurin17 openjdk17
# 安装 python3.12.3
choco install --accept-license  -y --pre vcredist2015 python312 
choco install --accept-license  -y python3 --version 3.12.3
# 安装 git
choco install --accept-license  -y --pre git.install git

关于choco的升级命令

choco upgrade chocolatey

参考

Can’t update pkg due to chocolatey-core.extension version mismatch

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值