Unremovable pin for the already removed package
Brief description of your issue
There was a package I actually pinned at some point.
Later it was removed(probably via Windows interface and not winget itself).
The pin is still present even though the package is not. And it is probably ok for some usecases(you might still want to keep your pins just in case), however, I can not remove the pin manually too since trying to do so results in "No installed package found matching input criteria." error.
So there is a pin for non-existent package which also cannot be removed. And winget reminds you of that each time saying that you need to upgrade the non-existent package manually because of the pin
Steps to reproduce
- Install a package with old version
- Pin it to some version, which is not the latest
- Remove it via standart Windows interface instead of winget command
- Try to run
winget update -u -r, it will say that there is a pin for a package(which is not present), and it needs to be upgraded manually winget pin listwill show the package(even though it is not installed)winget pin removewill not work since package is not actually present
Expected behavior
One of two things:
- Pin is automatically removed if the package is no longer present
- Pin is not automatically removed, however it should be possible to unpin it without the package presence.
Also: winget will not say anything about pins for packages which are not actually installed when you run an upgrade
Actual behavior
Winget is stuck at not being able to do anything with that "ghost" pin. Also it suggests to upgrade the pinned package manually, however it is not even present on the system to begin with
Environment
Windows Package Manager (Preview) v1.9.1792-preview
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.26120.961
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.24.1792.0
Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads D:\Downloads
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
--------------------------------------------------
LocalManifestFiles Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride Disabled
ProxyCommandLineOptions Disabled
DefaultProxy Disabled
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Open similar issues:
- Pinning/Unpinning should work for non-installed applications without
--idflag (#4163), similarity score: 0.79 - Winget Pin Error (#2989), similarity score: 0.78
- winget pinned package still showing up to be upgrade to next version (#2997), similarity score: 0.76
Closed similar issues:
- Unable to remove packages from pinned list if package is uninstalled. (#4161), similarity score: 0.83
- Pin removal fails if program was uninstalled manually (#4395), similarity score: 0.82
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I believe this is related to:
- https://github.com/microsoft/winget-cli/issues/4163
Can you try passing the full ID of the package with winget pin remove --id <ID> command?
I believe this is related to:
- https://github.com/microsoft/winget-cli/issues/4163
Can you try passing the full ID of the package with
winget pin remove --id <ID>command?
Yeah, it helped, thank you!