Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Chocolatey packages entirely from "local" resources?

Tags:

chocolatey

I am trying to install a Chocolatey package from local. Since I want to be able to store all the "artifacts" in a disk and go to a PC and just type

choco install <pkgname> -s D:\External\choco-repo

I noticed that the

choco search <pkgname> -s D:\External\choco-repo

works, however when I install it, it still pulls the artifacts from the HTTP feed. Is there a way to just use local storage or a network drive to perform installations?

Note that what I did was copy the contents of C:\ProgramData\chocolatey\lib to D:\External\choco-repo.

like image 777
javapadawan Avatar asked Feb 03 '16 05:02

javapadawan


People also ask

How do I download the files required to install chocolatey?

This includes downloading the required files from the Internet. If you look at the contents of the Chocolatey package, you will see the required URLs to download the EXE, MSI, and ZIP files required to do the install. The application installers are typically NOT contained within the Chocolatey package. This is due to distribution limitations.

Is it possible to generate your own internal packages in chocolatey?

Chocolatey is extremely powerful on its own, but having the ability to generate your own internal packages puts Chocolatey on a whole new level. Join the 4sysops PowerShell group!

How to open a nupkg file using chocolatey?

To easily inspect our .nupkg, we can use the NuGet Package Explorer, which we can install using Chocolatey: After installing this, you can open the generated nupkg files using the Package Explorer to see their contents.

Where are the application installers located in the chocolatey package?

The application installers are typically NOT contained within the Chocolatey package. This is due to distribution limitations.


1 Answers

Almost all Chocolatey packages are simply a wrapper around what you "would do" if you were to do the installation manually. This includes downloading the required files from the Internet.

If you look at the contents of the Chocolatey package, you will see the required URLs to download the EXE, MSI, and ZIP files required to do the install. The application installers are typically NOT contained within the Chocolatey package. This is due to distribution limitations.

Having said that, Chocolatey does download the required files to a known location on the hard drive, and as of the time of writing, if an installation of the same package is attempted, the cached downloaded version of the installer will be used, however, this technique is not guaranteed, or supported.

Instead, the best bet, in terms of your own maintainability, would be to modify the Chocolatey packages that you want to use, and instruct them to use the installer which you host internally, somewhere.

Going forward, the offline installation story with Chocolatey is planned to get better, but right now, there is still some manual work that you have to do.

like image 105
Gary Ewan Park Avatar answered Sep 19 '22 01:09

Gary Ewan Park