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

1

10

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.

Bough answered 3/2, 2016 at 5:56 Comment(0)
B
8

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.

Boxthorn answered 3/2, 2016 at 11:40 Comment(3)
thx for the explanation. Please note that being able to choco install a package from a local package would be a great (mandatory?) feature to have for Chocolatey Admins who have to do repackaging before releasing custom packages on a local repo, to meet their entreprise requirements.Sever
Since writing this answer, there have been a number of changes to the features in the licensed version of Chocolatey, which extend it with a number of features for just this scenario. For example, have a look here: chocolatey.org/docs/features-automatically-recompile-packagesBoxthorn
I would be using the open-source version as of today. We are still in POC phase. Anyways: congrats for this great product!!! It opens thousands of possibilities, even as a DEV-OPS tool. KEEP IT UP!Sever

© 2022 - 2024 — McMap. All rights reserved.