如何在ProGet中设置Chocolatey Feed作为Chocolatey的来源?

时间:2017-11-09 20:43:40

标签: chocolatey proget

我在ProGet中创建了一个名为" Chocolatey"的Chocolatey Feed。现在我如何在Chocolatey中使用它?

我尝试运行此命令来添加源:

PS> choco source add --name=ProGet --source="http://my-proget-server/feeds/Chocolatey"
Chocolatey v0.10.8
Added ProGet - http://my-proget-server/feeds/Chocolatey (Priority 0)

并且命令工作就像列出" ProGet"作为来源:

PS> choco source list
Chocolatey v0.10.8
chocolatey - https://chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
ProGet - http://my-proget-server/feeds/Chocolatey | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.

然后我禁用了默认来源:

PS> choco source disable --name=chocolatey
Chocolatey v0.10.8
Disabled chocolatey

但我必须设置ProGet来源错误,因为choco search无效:

PS> choco search curl
Chocolatey v0.10.8
The remote server returned an error: (400) Bad Request.

1 个答案:

答案 0 :(得分:2)

我应该将source命令的choco source add参数设置为"包源URL"饲料。我提供的价值实际上是'详细信息' ProGet webapp中的Feed页面,该页面显示了包源URL。在我的例子中,正确的命令(删除坏源后)是:

choco source add --name=ProGet --source="http://my-proget-server/nuget/Chocolatey"

以下是修复问题并测试它是否正常工作的所有命令,一起[在命令输出和任何后续命令之间添加空格]:

PS> choco source remove --name=ProGet
Chocolatey v0.10.8
Removed ProGet

PS> choco source add --name=ProGet --source="http://my-proget-server/nuget/Chocolatey"
Chocolatey v0.10.8
Added ProGet - http://my-proget-server/nuget/Chocolatey (Priority 0)

PS> choco source disable --name=chocolatey
Chocolatey v0.10.8
Nothing to change. Config already set.

PS> choco source list
Chocolatey v0.10.8
chocolatey [Disabled] - https://chocolatey.org/api/v2/ | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.
ProGet - http://my-proget-server/nuget/Chocolatey | Priority 0|Bypass Proxy - False|Self-Service - False|Admin Only - False.

PS> choco search curl
Chocolatey v0.10.8
curl 7.56.1 [Approved]
Cmder 1.3.3 [Approved] Downloads cached for licensed users
cmdermini 1.3.3 [Approved] Downloads cached for licensed users
insomnia-rest-api-client 5.11.0 [Approved] Downloads cached for licensed users
rust 1.21.0 [Approved] Downloads cached for licensed users
git-lfx 0.1.0 [Approved]
jivkok.dev1 1.1.0.8 - Possibly broken
etcd 3.2.9 [Approved] Downloads cached for licensed users
tivotogo-plex 2016.12.30 [Approved] Downloads cached for licensed users
rust-ms 1.21.0 [Approved] Downloads cached for licensed users
mve 2016.05.17.00 [Approved] Downloads cached for licensed users
11 packages found.