Home > Uncategorized > Create your own nuget server to serve packages for Chocolatey

Create your own nuget server to serve packages for Chocolatey

Create a nupkg store:
1) Create a store:

mkdir c:\packagestore

2) Grab a few packages from the Chocolatey repo:

cd c:\packagestore
wget http://chocolatey.org/api/v2/package/spacesniffer/
wget http://chocolatey.org/api/v2/package/procmon/
wget http://chocolatey.org/api/v2/package/VirtualCloneDrive/

Create a nuget web repo:
1) Download visual studio 2012 express for web (try: `cinst VisualStudioExpress2012Web`).
2) Open Visual Studio 2012 Express for Web.
3) On the left pane, choose Template>your language> Web.
4) In the middle pane, select ASP.NET Empty Web Application, enter a name for your project and create new.
5) Go to Tools menu> Extensions and Updates.
6) On the left pane, choose Updates> update everything.
7) Go to Tools menu> Library Package Manager> Manage NuGet Packages for Solution…
9) On the left pane, choose Online>All
10) In the upper right, search for nuget.server and install into this project.

Configure and run the project:
1) In the source tree of the Solution Explorer pane, open web.config.
2) Search for “packagesPath” and set the value to “c:\packagestore”
3) Hit CTRL+F5 to build and run
4) You will be directed to localhost:1061

Update Chocolatey’s nuget:

%chocolateyinstall%\chocolateyinstall\nuget.exe update -self

Use Chocolatey to list and install packages from the source:
Listing works, but installing doesn’t. Not sure why now.

chocolatey list -source ""http://localhost:1601/nuget""
chocolatey install all -source ""http://localhost:1601/nuget""

Additionally, look at NuGet Gallery.

References:

Advertisements
  1. October 29, 2014 at 2:09 pm

    “Listing works, but installing doesn’t. Not sure why now.”

    Did you get the installing part to work ?

    • October 29, 2014 at 5:40 pm

      Haven’t touched this in a very long time, so I am of not help. Apologies.

  2. October 30, 2015 at 3:49 pm

    On my linux box the “chocolatey wget” results in a file called “index.html”. To make the file save with the correct name I had to add “–content-disposition”, like so:

    wget –content-disposition https://chocolatey.org/api/v2/package/growl/

    • October 30, 2015 at 4:55 pm

      Why would you be using chocolatey on *nix? Isn’t it a Windows package manager?

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: