4

我在 ProGet 中创建了一个名为“Chocolatey”的 Chocolatey 提要。现在我如何从 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.
4

1 回答 1

3

我应该source将命令的参数设置choco source add为提要的“包源 URL”。我提供的值实际上是 ProGet webapp 中提要的“详细信息”页面,该页面显示包源 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.
于 2017-11-09T20:43:40.067 回答