--uninstall-previous doesn't seem to be working
There is already an --uninstall-previous option which was intended to cover this case, but last time I tried it, it didn't seem to work for this case. I was going to retest that the other day and file an issue if it failed, but at some point I already upgraded PowerShell to 7.4.1 so I'll wait for the next release and if this issue happens again, follow through on that investigation.
(Unless someone else looks into it first, of course...)
Originally posted by @TBBle in https://github.com/microsoft/winget-cli/discussions/2155#discussioncomment-8974299
[Policy] Issue Bug [Policy] Command Upgrade
Having the same issue in Windows Terminal with
winget update "PowerShell 7.4.6.0-x64" --uninstall-previous
not wanting to upgrade my Powershell to the current 7.5.0.0 version, saying
A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.
In my experience --uninstall-previous is generally working. I use it regularly for one software that requires it because of an installer quirk in my setup. As for the bug that the installer technology is being matched even though uninstall is supposed to be performed, this ticket might be a potential duplicate of #4677 . I just updated the title of that ticket to describe the bug a bit more precisely.
Can confirm that --uninstall-previous seems to not be working, unless I misunderstand the behavior.
My test used 1Password as a sample app:
- Install version 8.10.16 using command
winget install -e -id AgileBits.1Password -v "8.10.16" - Try to upgrade to version 8.10.18 using command
winget upgrade -e -id AgileBits.1Password -v "8.10.18" --uninstall-previousor with the equivalentinstallcommand.
Expected behavior:
For version 8.10.18 of 1Password to be installed on my machine.
Actual behavior:
Winget doesn't upgrade my package, given by these output logs:
Found an existing package already installed. Trying to upgrade the installed package... No available upgrade found. No newer package versions are available from the configured sources.
and the fact that 8.10.16 is still my current version of 1Password.
Am I doing something wrong?
+1 facing the issue upgrading Meld.Meld 3.22.2 to 3.24.0
> winget upgrade Meld.Meld --uninstall-previous
A newer version was found, but the install technology is different from the current version installed. Please uninstall the package and install the newer version.
winget v1.29.280