Skip to content

Commit c863211

Browse files
authored
Merge pull request #1041 from pauby/doc/add-dependency-yt-video
(doc) Add dependency issues YouTube video
2 parents ace4c33 + 72c4e4a commit c863211

File tree

1 file changed

+97
-93
lines changed

1 file changed

+97
-93
lines changed
Lines changed: 97 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,97 @@
1-
---
2-
order: 10
3-
xref: choco-dependency-troubles
4-
title: Dependency Troubleshooting in Chocolatey CLI
5-
description: Troubleshooting steps for when you encounter issues related to dependencies
6-
---
7-
import Callout from '@choco/components/Callout.astro';
8-
import Iframe from '@choco/components/Iframe.astro';
9-
import Xref from '@components/Xref.astro';
10-
11-
## Installation and Upgrade Commands Fail for Many Seemingly Unrelated Packages
12-
13-
Due to the way dependency resolution works, packages with dependencies can occasionally trigger undesirable behavior.
14-
When this happens, you will often be presented with both warnings and errors.
15-
The most important information will be in the errors, and not the warnings.
16-
17-
When you encounter these errors, it is recommended to start with the package name mentioned in the error, and attempt to install it.
18-
Repeat this process with any other failing dependencies until they're all installed.
19-
20-
### Example 1 - Upgrade All Fails to Upgrade One or More Packages
21-
22-
This will sometimes be encountered with meta-packages, such as `obs-studio` which takes an exact-version dependency on `obs-studio.install`.
23-
When running `choco upgrade all` it will attempt to upgrade every installed package.
24-
Any packages which fail to install may be retried as part of a later dependency chain.
25-
For example, `obs-studio.install` may be upgraded, fail, and then later be tried again as part of the dependency chain for `obs-studio` itself.
26-
As a result, Chocolatey CLI's packages may be in an inconsistent state.
27-
This is typically characterized by a dependency resolution error message when performing package operations:
28-
29-
```
30-
Unable to resolve dependencies. 'obs-studio.install 29.0.2' is not compatible with 'obs-studio 29.1.1 constraint: obs-studio.install (>= 29.1.1)'.
31-
```
32-
33-
This is normally resolved by upgrading the affected dependency.
34-
In this example, you would run `choco upgrade obs-studio.install` to resolve the issue.
35-
36-
The following scenario illustrates what can happen during an `upgrade all` where a dependency fails to install.
37-
In this example, `obs-studio` installs, but `obs-studio.install` fails.
38-
Due to the dependency version range specified by `obs-studio`, the version of `obs-studio.install` that remains installed (due to the upgrade failure) does not satisfy the dependency requirement.
39-
40-
To resolve the issue, we run `choco upgrade obs-studio.install` to get the correct dependency version installed.
41-
For packages that have a specific version dependency, add the `--version` option and specify the exact version to install.
42-
43-
![Partial output from choco upgrade all, showing that obs-studio.install is attempted and failed](/images/chocolatey/dependency-resolution-failure-1.png)
44-
45-
![Continued output from choco upgrade all, showing that obs-studio metapackage is installed and subsequently re-attempts the upgrade to obs-studio.install which again fails, followed by a dependency resolution error in the next package and failing a seemingly unrelated package installation](/images/chocolatey/dependency-resolution-failure-2.png)
46-
47-
### Example 2 - Installing a Package Fails Due to Existing Missing Dependencies
48-
49-
<Callout type="warning">
50-
This example deals with multiple missing dependencies, and installs them while ignoring dependencies.
51-
You will need to ensure you're installing the correct versions required for your dependencies.
52-
</Callout>
53-
54-
The following scenario illustrates what can happen during an `install` where multiple existing packages have dependencies that are not currently met.
55-
In this example, `glab` is attempting to be installed, but a number of `KB` packages are missing from the Chocolatey `lib` directory.
56-
57-
1. We start by attempting to install `glab`, and note that that the following error occurs.
58-
59-
![Output from choco install glab where it fails to resolve dependency 'KB306858'](/images/chocolatey/kb-dependency-failure-1.png)
60-
61-
1. To resolve the issue, we first run `choco install KB3063858` to install the first identified package.
62-
We note that this fails to install, so we make note of the package it couldn't find (`KB2919355`) and we run `choco install KB3063858 --ignore-dependencies` to ignore the dependency failure.
63-
64-
![Output from choco install KB306858 where it fails to resolve dependency 'KB2919355'](/images/chocolatey/kb-dependency-failure-2.png)
65-
66-
1. Now that we have `KB3063858` installed, we attempt to run `choco install KB2919355` to install the next identified package.
67-
Again we make note of the next package (`KB2999226`) and install this package while ignoring dependencies: `choco install KB2919355 --ignore-dependencies`.
68-
69-
![Output from choco install KB2919355 where it fails to resolve dependency 'KB2999226'](/images/chocolatey/kb-dependency-failure-3.png)
70-
71-
1. Now with `KB2919355` installed we continue with `choco install KB2999226`.
72-
Again we make note of the next package (`KB2919442`) and install this package while ignoring dependencies: `choco install KB2999226 --ignore-dependencies`.
73-
74-
![Output from choco install KB2999226 where it fails to resolve dependency 'KB2919442'](/images/chocolatey/kb-dependency-failure-4.png)
75-
76-
1. Now with `KB2999226` installed, we attempt to run `choco install KB2919442`.
77-
We see that this one is actually already installed, so we attempt to install `glab` again.
78-
When `glab` fails to install, we make note of the next package missing in our chain: `chocolatey-windowsupdate.extension`.
79-
80-
![Output from choco install KB2919442 where it is already installed. Following output is from choco install glab where it fails to resolve dependency 'chocolatey-windowsupdate.extension'](/images/chocolatey/kb-dependency-failure-5.png)
81-
82-
1. We install this in the same way as before (`choco install chocolatey-windowsupdate.extension`, then `choco install chocolatey-windowsupdate.extension --ignore-dependencies`).
83-
84-
![Output from choco install chocolatey-windowsupdate.extension where it fails to resolve dependency 'KB3033929'](/images/chocolatey/kb-dependency-failure-6.png)
85-
86-
1. We install the next package (`KB3033929`) and note that it did not have any dependency failures.
87-
88-
![Output from choco install KB3033929 where it installs with no dependency failures](/images/chocolatey/kb-dependency-failure-7.png)
89-
90-
1. So, we attempt our install of `glab` once more.
91-
Thankfully, we are able to install it with no dependency errors.
92-
93-
![Output from choco install glab where it finally installs](/images/chocolatey/kb-dependency-failure-8.png)
1+
---
2+
order: 10
3+
xref: choco-dependency-troubles
4+
title: Dependency Troubleshooting in Chocolatey CLI
5+
description: Troubleshooting steps for when you encounter issues related to dependencies
6+
---
7+
import Callout from '@choco/components/Callout.astro';
8+
import Iframe from '@choco/components/Iframe.astro';
9+
import Xref from '@components/Xref.astro';
10+
11+
## Installation and Upgrade Commands Fail for Many Seemingly Unrelated Packages
12+
13+
Due to the way dependency resolution works, packages with dependencies can occasionally trigger undesirable behavior.
14+
When this happens, you will often be presented with both warnings and errors.
15+
The most important information will be in the errors, and not the warnings.
16+
17+
When you encounter these errors, it is recommended to start with the package name mentioned in the error, and attempt to install it.
18+
Repeat this process with any other failing dependencies until they're all installed.
19+
20+
In a previous livestream we demoed some of the dependency issues you may experience.
21+
22+
<Iframe ratio="16x9" link="https://www.youtube.com/embed/mulMztVQzQU?si=ZOFdN8Tr4cjB0Dt6&amp;start=1208" title="Troubleshooting Chocolatey Package Dependencies" />
23+
24+
### Example 1 - Upgrade All Fails to Upgrade One or More Packages
25+
26+
This will sometimes be encountered with meta-packages, such as `obs-studio` which takes an exact-version dependency on `obs-studio.install`.
27+
When running `choco upgrade all` it will attempt to upgrade every installed package.
28+
Any packages which fail to install may be retried as part of a later dependency chain.
29+
For example, `obs-studio.install` may be upgraded, fail, and then later be tried again as part of the dependency chain for `obs-studio` itself.
30+
As a result, Chocolatey CLI's packages may be in an inconsistent state.
31+
This is typically characterized by a dependency resolution error message when performing package operations:
32+
33+
```
34+
Unable to resolve dependencies. 'obs-studio.install 29.0.2' is not compatible with 'obs-studio 29.1.1 constraint: obs-studio.install (>= 29.1.1)'.
35+
```
36+
37+
This is normally resolved by upgrading the affected dependency.
38+
In this example, you would run `choco upgrade obs-studio.install` to resolve the issue.
39+
40+
The following scenario illustrates what can happen during an `upgrade all` where a dependency fails to install.
41+
In this example, `obs-studio` installs, but `obs-studio.install` fails.
42+
Due to the dependency version range specified by `obs-studio`, the version of `obs-studio.install` that remains installed (due to the upgrade failure) does not satisfy the dependency requirement.
43+
44+
To resolve the issue, we run `choco upgrade obs-studio.install` to get the correct dependency version installed.
45+
For packages that have a specific version dependency, add the `--version` option and specify the exact version to install.
46+
47+
![Partial output from choco upgrade all, showing that obs-studio.install is attempted and failed](/images/chocolatey/dependency-resolution-failure-1.png)
48+
49+
![Continued output from choco upgrade all, showing that obs-studio metapackage is installed and subsequently re-attempts the upgrade to obs-studio.install which again fails, followed by a dependency resolution error in the next package and failing a seemingly unrelated package installation](/images/chocolatey/dependency-resolution-failure-2.png)
50+
51+
### Example 2 - Installing a Package Fails Due to Existing Missing Dependencies
52+
53+
<Callout type="warning">
54+
This example deals with multiple missing dependencies, and installs them while ignoring dependencies.
55+
You will need to ensure you're installing the correct versions required for your dependencies.
56+
</Callout>
57+
58+
The following scenario illustrates what can happen during an `install` where multiple existing packages have dependencies that are not currently met.
59+
In this example, `glab` is attempting to be installed, but a number of `KB` packages are missing from the Chocolatey `lib` directory.
60+
61+
1. We start by attempting to install `glab`, and note that that the following error occurs.
62+
63+
![Output from choco install glab where it fails to resolve dependency 'KB306858'](/images/chocolatey/kb-dependency-failure-1.png)
64+
65+
1. To resolve the issue, we first run `choco install KB3063858` to install the first identified package.
66+
We note that this fails to install, so we make note of the package it couldn't find (`KB2919355`) and we run `choco install KB3063858 --ignore-dependencies` to ignore the dependency failure.
67+
68+
![Output from choco install KB306858 where it fails to resolve dependency 'KB2919355'](/images/chocolatey/kb-dependency-failure-2.png)
69+
70+
1. Now that we have `KB3063858` installed, we attempt to run `choco install KB2919355` to install the next identified package.
71+
Again we make note of the next package (`KB2999226`) and install this package while ignoring dependencies: `choco install KB2919355 --ignore-dependencies`.
72+
73+
![Output from choco install KB2919355 where it fails to resolve dependency 'KB2999226'](/images/chocolatey/kb-dependency-failure-3.png)
74+
75+
1. Now with `KB2919355` installed we continue with `choco install KB2999226`.
76+
Again we make note of the next package (`KB2919442`) and install this package while ignoring dependencies: `choco install KB2999226 --ignore-dependencies`.
77+
78+
![Output from choco install KB2999226 where it fails to resolve dependency 'KB2919442'](/images/chocolatey/kb-dependency-failure-4.png)
79+
80+
1. Now with `KB2999226` installed, we attempt to run `choco install KB2919442`.
81+
We see that this one is actually already installed, so we attempt to install `glab` again.
82+
When `glab` fails to install, we make note of the next package missing in our chain: `chocolatey-windowsupdate.extension`.
83+
84+
![Output from choco install KB2919442 where it is already installed. Following output is from choco install glab where it fails to resolve dependency 'chocolatey-windowsupdate.extension'](/images/chocolatey/kb-dependency-failure-5.png)
85+
86+
1. We install this in the same way as before (`choco install chocolatey-windowsupdate.extension`, then `choco install chocolatey-windowsupdate.extension --ignore-dependencies`).
87+
88+
![Output from choco install chocolatey-windowsupdate.extension where it fails to resolve dependency 'KB3033929'](/images/chocolatey/kb-dependency-failure-6.png)
89+
90+
1. We install the next package (`KB3033929`) and note that it did not have any dependency failures.
91+
92+
![Output from choco install KB3033929 where it installs with no dependency failures](/images/chocolatey/kb-dependency-failure-7.png)
93+
94+
1. So, we attempt our install of `glab` once more.
95+
Thankfully, we are able to install it with no dependency errors.
96+
97+
![Output from choco install glab where it finally installs](/images/chocolatey/kb-dependency-failure-8.png)

0 commit comments

Comments
 (0)