Skip to content

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

@sagisar1

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>
....
...

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