gregsdennis
gregsdennis

Reputation: 8428

How do I configure a local Chocolatey repository?

I'm trying to learn about Chocolatey by setting up a local repository on my machine (c:\ChocolateyLocal\). However, I can't seem to add the folder as a source. I've tried using the command line and ChocolateyGui, and I get the same error:

Failed to query source.

The paths I've tried are (all with and without trailing \):

I'm using the latest Chocolatey (v0.9.9.11).

Upvotes: 9

Views: 21450

Answers (3)

Developer
Developer

Reputation: 26293

Further to what ferventcoder replied above.

You can also add username and password by running the following command in the command prompt.

 C:\ProgramData\chocolatey\bin\choco.exe source add -n=name -u=username -p="xxxxxx" -s="https://xxx.xxxx.xx.xx/repository/chocolatey-all/"

Following line will be added in file C:\ProgramData\chocolatey\config\chocolatey.config

<source id="name" value="https://xxx.xxxx.xx.xx/repository/chocolatey-all/" disabled="false" bypassProxy="false" selfService="false" adminOnly="false" user="username" password="Chocolatey will encrypt the password and put it here" priority="0" />

Files location can be different depending on where it is installed

Upvotes: 0

Gary Ewan Park
Gary Ewan Park

Reputation: 19021

Currently, there is a disconnect between ChocolateyGUI and Chocolatey, in terms of the sources that are defined. This is a known issue, which is being tracked on this issue. There was some initial work to reconcile these two sources configuration files in this pull request, but that hasn't been pulled in yet. This is due to the fact that we are moving ChocolateyGUI to use the Chocolatey Library, which means they will be configured out of the box. This work is still on going though.

For now, you can add Sources into ChocolateyGUI by following the instructions in this wiki article. The instructions are copied below as well:

  1. Open ChocolateyGUI
  2. Click the "settings" button at the top right of the screen
  3. Click Sources
  4. Enter the Name for the new Source
  5. Enter the Url for the new Source
  6. Click the "add source" button

Hope this helps!

Upvotes: 3

ferventcoder
ferventcoder

Reputation: 12621

What version of Chocolatey are you using?

choco source add -n name -s location

https://github.com/chocolatey/choco/wiki/CommandsSources

A side note - you may also need at least 1 package in there.

Upvotes: 11

Related Questions