You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this is the correct repository for opening this issue.
I have verified no other issues exist related to my problem.
I have verified this is not an issue for a specific package.
I have verified this issue is not security related.
I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
When uninstalling a package with its dependencies using command: choco uninstall -x -y <pkg>
Chocolatey 2.4.0 will uninstall package dependencies before the package itself. That does not seem to be the correct order.
On the other hand, Chocolatey 1.4.0 will uninstall the package itself before its dependencies. That's the expected behavior.
This looks like a regression defect.
What is Expected?
When uninstalling a package with its dependencies, the package should be uninstalled before its dependencies.
How Did You Get This To Happen?
The following replication steps are performed in Windows Sandbox to ensure a clean environment.
Install Chocolatey 2.4.0 in Windows Sandbox;
Install package chocolatey-core.extension with the following command:
choco install -y chocolatey-core.extension
Chocolatey will install its dependency chocolatey-compatibility.extension v1.0.0, then that package itsself chocolatey-core.extension v1.4.0.
Now uninstall chocolatey-core.extension with its dependencies:
choco uninstall -x -y chocolatey-core.extension
The output from the above command is:
Chocolatey v2.4.0
Uninstalling the following packages:
chocolatey-core.extension
chocolatey-compatibility.extension v1.0.0
Skipping auto uninstaller - No registry snapshot.
Uninstalled chocolatey-compatibility extensions.
chocolatey-compatibility.extension has been successfully uninstalled.
chocolatey-core.extension v1.4.0
Skipping auto uninstaller - No registry snapshot.
Uninstalled chocolatey-core extensions.
chocolatey-core.extension has been successfully uninstalled.
Chocolatey uninstalled 2/2 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Apparently the dependency package (chocolatey-compatibility.extension) has been uninstalled before the package itself (chocolatey-core.extension).
Chocolatey v1.4.0
Uninstalling the following packages:
chocolatey-core.extension
chocolatey-core.extension v1.4.0
Skipping auto uninstaller - No registry snapshot.
Uninstalled chocolatey-core extensions.
chocolatey-core.extension has been successfully uninstalled.
chocolatey-compatibility.extension v1.0.0
Skipping auto uninstaller - No registry snapshot.
Uninstalled chocolatey-compatibility extensions.
chocolatey-compatibility.extension has been successfully uninstalled.
Chocolatey uninstalled 2/2 packages.
That means Chocolatey 1.4.0 uninstalls the package chocolatey-core.extension before its dependency chocolatey-compatibility.extension correctly.
In more sophisticated cases, the dependency could be a extension package that contains PowerShell module required by the uninstall script. If such kind of dependencies have been uninstalled first, uninstallation of impacted packages will fail. This is a quite serious regression defect.
I can confirm this happens in 2.4.0. I can also confirm that the ordering of packages to uninstall appears to be done alphabetically, so our test package hasdependency doesn't present this issue.
pauby
changed the title
choco uninstall: Wrong dependency uninstall order
Packages are uninstalled in the wrong order when uninstalling a package with its dependencies
Dec 4, 2024
Checklist
What You Are Seeing?
When uninstalling a package with its dependencies using command:
choco uninstall -x -y <pkg>
Chocolatey 2.4.0 will uninstall package dependencies before the package itself. That does not seem to be the correct order.
On the other hand, Chocolatey 1.4.0 will uninstall the package itself before its dependencies. That's the expected behavior.
This looks like a regression defect.
What is Expected?
When uninstalling a package with its dependencies, the package should be uninstalled before its dependencies.
How Did You Get This To Happen?
The following replication steps are performed in Windows Sandbox to ensure a clean environment.
Install Chocolatey 2.4.0 in Windows Sandbox;
Install package
chocolatey-core.extension
with the following command:choco install -y chocolatey-core.extension
Chocolatey will install its dependency
chocolatey-compatibility.extension
v1.0.0, then that package itsselfchocolatey-core.extension
v1.4.0.Now uninstall
chocolatey-core.extension
with its dependencies:choco uninstall -x -y chocolatey-core.extension
The output from the above command is:
Apparently the dependency package (
chocolatey-compatibility.extension
) has been uninstalled before the package itself (chocolatey-core.extension
).Downgrade Chocolatey to version 1.4.0:
choco upgrade chocolatey -version 1.4.0 -allow-downgrade -y
Repeat steps 2 and 3:
The output from the uninstall command is:
That means Chocolatey 1.4.0 uninstalls the package
chocolatey-core.extension
before its dependencychocolatey-compatibility.extension
correctly.System Details
Installed Packages
Output Log
Additional Context
Note: I only included log for Chocolatey v2.4.0
The text was updated successfully, but these errors were encountered: