chocolateyproget

How do I setup a Chocolatey feed in ProGet as a source for Chocolatey?


I created a Chocolatey feed, named "Chocolatey", in ProGet. Now how do I use it from Chocolatey?

I tried running this command to add the source:

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)

and the command worked in as much as it lists "ProGet" as a source:

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.

I then disabled the default source:

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

But I must have setup the ProGet source wrong as choco search doesn't work:

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

Solution

  • I should have set the source parameter of the choco source add command to the "Package Source URL" of the feed. The value I provided is actually the 'details' page for the feed in the ProGet webapp and that page shows the package source URL. In my case, the correct command to run (after removing the bad source) was:

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

    Here are all the commands to fix the problem and test that it works, all together [with added spaces between the output of a command and any subsequent command]:

    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.