Skip to content

Winget doesn't remove older version when upgrading certain pacakges #5615

Closed

Description

@sagisar1

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

  1. use the winget upgrade command to see which packages has an ugprade available
  2. upgrade some package that has an upgrade available, for example:
    winget upgrade --id "Microsoft.VCRedist.2013.x86"
  3. make sure the upgrade process finishes successfully.
  4. 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

  1. denelon commented on Jul 25, 2025

    @denelon
    Collaborator

    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.

  2. denelon commented on Jul 25, 2025

    @denelon
    Collaborator

    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.

  3. locked and limited conversation to collaborators on Jul 25, 2025
  4. converted this issue into a discussion #5620 on Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions