Repository navigation
Description
Brief description of your issue
Hello, I have noticed for a while, and now I see it is something that persists in many applications on my windows OS, that winget-cli, when used with winget upgrade <some-packages> , doesn't remove sometimes the old version of an application/package, which is the actual purpose of an upgrade and what it should do - to replace a newer version with an older one. as a result, I see many duplicate applications in control panel "apps and features" section.
for example - i have Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.40660
but in the same time i also have
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.21005
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.40664
etc.
so as you can understand, this versions are installed because of winget not uninstalling the previous ones.
this is really a bad situation, because instead of helping managing packages and applications easily, it makes the system to have redundent versions of applications, and increase the disk size.
Steps to reproduce
- use the
winget upgradecommand to see which packages has an ugprade available - upgrade some package that has an upgrade available, for example:
winget upgrade --id "Microsoft.VCRedist.2013.x86" - make sure the upgrade process finishes successfully.
- open control panel-> apps and features, and observe that you have now two versions of the same application.
Expected behavior
winget upgrades a package to a newer version, and also deletes the older existing version
Actual behavior
winget upgrades a package to a newer version, but does not delete the older existing version
Environment
output of winget --info
Windows: Windows.Desktop v10.0.19045.6093
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.26.400.0
Winget Directories
--------------------------------------------------------------------------------------------
<directoris here>
....
...
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
<admin-settings here>
....
...
Activity
denelon commentedon Jul 25, 2025
The upgrade behavior is specified in the manifest. Sometimes the manifest will specify "uninstallPrevious" to uninstall the earlier version and sometimes it's just "upgrade". This is often based on whether the new application version gets installed side by side with the older version, and if any settings might be lost by performing an uninstall.
denelon commentedon Jul 25, 2025
Dependencies like the VC++ redistributables are often left alone as removing an earlier version may break an application with an explicit dependency on a specific version.