Search code examples
dependencieschocolatey

How to install Chocolatey packages without overwriting dependencies?


I am trying to create and install different packages on my own feed and encountered an issue installing packages depending on the same software.

For example:\

  • Package A depends on Package C Version 2.0
  • Package B depends on Package C Version 1.5

If I install both packages one after another, the second installation ignores the dependency to C from the first one and installs its own dependency.

  • Install A -> Install B => C v1.5 available
  • Install B -> Install A => C v2.0 available

Is there a way to tell Chocolatey to check all existing dependencies and fail if some versions are incompatible?


Solution

  • I already forgot my own question here, but want to leave my solution for other people who encounter the same problem.

    You can use 'choco upgrade' instead of 'choco install'. The upgrade function can also install new packages to your system and compares existing dependencies with the new ones resolved for the installation.