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

Unremovable pin for the already removed package

Open Hekzory opened this issue 1 year ago • 1 comments

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

  1. Install a package with old version
  2. Pin it to some version, which is not the latest
  3. Remove it via standart Windows interface instead of winget command
  4. 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
  5. winget pin list will show the package(even though it is not installed)
  6. winget pin remove will not work since package is not actually present

Expected behavior

One of two things:

  1. Pin is automatically removed if the package is no longer present
  2. 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

Hekzory avatar Jun 30 '24 13:06 Hekzory

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:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jun 30 '24 13:06 github-actions[bot]

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?

mdanish-kh avatar Jul 01 '24 04:07 mdanish-kh

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!

Hekzory avatar Jul 01 '24 17:07 Hekzory