winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

--uninstall-previous doesn't seem to be working

Open Trenly opened this issue 1 year ago • 5 comments

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

Trenly avatar Jan 14 '25 22:01 Trenly

[Policy] Issue Bug [Policy] Command Upgrade

Trenly avatar Jan 14 '25 22:01 Trenly

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.

recspert avatar Feb 01 '25 09:02 recspert

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.

spizacode avatar Aug 19 '25 07:08 spizacode

Can confirm that --uninstall-previous seems to not be working, unless I misunderstand the behavior.

My test used 1Password as a sample app:

  1. Install version 8.10.16 using command winget install -e -id AgileBits.1Password -v "8.10.16"
  2. Try to upgrade to version 8.10.18 using command winget upgrade -e -id AgileBits.1Password -v "8.10.18" --uninstall-previous or with the equivalent install command.

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?

nathlrowe avatar Mar 19 '26 01:03 nathlrowe

+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

r-amm avatar Jul 16 '26 14:07 r-amm