Can I build Chocolatey packages on Linux?
Asked Answered
C

1

6

It's pretty easy to build Chocolatey packages on a Windows machine. But, so far, I haven't found a documented way to build packages on Linux.

For example, how would I run choco.exe, a Windows executable, on Linux?

Cerf answered 8/9, 2016 at 8:48 Comment(1)
If choco.exe is a .NET assembly, you should be able to run mono choco.exe to run it on Linux. The issue is that I can't figure out how to obtain the executable without actually installing Chocolatey (and the install script doesn't seem to work on Linux)Gerik
S
7

Since around 2014, running Chocolatey on Linux machines (using Mono have been supported). Rob Reynolds, the creator of Chocolatey actually demoed this capability at PuppetConf 2014. The demo of creating a package starts around the 11 minute mark in that video. As a result, the process of building a Chocolatey package, i.e. choco pack is currently supported today.

NOTE: I have assumed that the terminology of building a package is the same as creating a package.

Currently, a choco binary, which is compiled for usage on Linux is not distributed anywhere. However, we do currently build Choco using Travis. You can see the YAML file here. In theory, you should be able to grab the source code from GitHub, then execute the same commands that Travis does, to generate a compiled version of choco that you can use on Linux.

Silvia answered 8/9, 2016 at 8:58 Comment(5)
Do you know if Rob publishes the mono executable or do you have to build from source or something?Sojourn
It is not published, but we run Travis-CI against it, so it shows how it is built and tested.Irritation
Can you explain in more detail how I can run choco pack on Linux (Ubuntu)? Can I use mono from the Ubuntu repository (currently version 4.2.1.102)? How can I use it if it's not published according to @ferventcoder?Cerf
@pascal-mages I have updated the answer with some notes that will point you in the right direction. This isn't something that I have ever done though.Silvia
If choco.exe is a .NET assembly, you should be able to run mono choco.exe to run it on Linux, without actually having to recompile it (since .NET assemblies use bytecode).Gerik

© 2022 - 2024 — McMap. All rights reserved.