winget-cli
winget-cli copied to clipboard
Uninstall via SSH: "A specified logon session does not exist. It may already hav e been terminated." error with several products
Brief description of your issue
Using winget via ssh (Open SSH), I cannot uninstall most of the builtin apps. For instance, running 'winget uninstall "Phone Link"' will fail via ssh, but not in a graphical session.
Steps to reproduce
Run
winget uninstall "Phone Link"
via an ssh session
Expected behavior
The product is uninstalled
Actual behavior
>winget uninstall "Phone Link" Failed in attempting to update the source: winget Found Phone Link [Microsoft.YourPhone_8wekyb3d8bbwe] Starting package uninstall... Uninstall failed with exit code: 0x80070520 : A specified logon session does not exist. It may already have been terminated.
Environment
>winget --info
Windows Package Manager v1.3.2091
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19044.2006
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2091.0
When you are using ssh, are you connecting to a specific user/Windows account that has winget provisioned, or are you connecting to the system account?
The Windows Package Manager is distributed with the App Installer which is an MSIX package. The package needs to be registered for an "interactive" account that has been logged into. If you are using the "system" context, the package is not registered.
Thanks for your answer. Yes, this is the only user account, with Administrator rights. I am still not sure to understand what "interactive account" means, but I can launch winget to install, for instance, Python, Java and Visual Studio without any issue.
I should have stated "interactive session". The Windows Package Manager doesn't get registered for an account until a user has "logged in" to an account on the local machine. If you log on as "system" then you can use winget in that account. If you're just remoting in, it may not be registered.
Using my AAD account, I was able to:
winget uninstall "Phone Link"
Found Phone Link [Microsoft.YourPhone_8wekyb3d8bbwe]
Starting package uninstall...
██████████████████████████████ 100%
Successfully uninstalled
and subsequently:
winget install "Phone Link" -s msstore
Found Phone Link [9NMPJ99VJBWV] Version Unknown
This package is provided through Microsoft Store. winget may need to acquire the package from Microsoft Store on behalf of the current user.
Version: Unknown
Publisher: Microsoft Corporation
Description:
You love your phone. So does your PC. Get instant access to everything you love on your phone, right from your PC.
Link your Android phone and PC to view and reply to text messages, make and receive calls*, view your notifications, and more.
Make emailing yourself photos a thing of the past as you share your favorite images between your phone and PC. Copy, edit, and even drag and drop photos without ever touching your phone.
For select** Microsoft Duo, Samsung, and HONOR phones access your favorite mobile apps on your PC. Continue working by wirelessly dragging and dropping your files from your phone to your PC (and vice versa).
Let us know what features you’d like to see next by selecting “Send feedback” in the Phone Link app settings.
For cross-device experiences to work, you must link your Android phone (running Android 7 or later) with your PC, through the Phone Link app.
*Calls requires a Windows 10 PC with Bluetooth capability.
**Drag and drop, Phone screen and Apps all require a compatible Android device (aka.ms/phonelinkdevices). The multiple apps experience requires a Windows 10 PC running the May 2020 Update or later and has at least 8GB of RAM, and your Android device must be running Android 11.0.
License: https://go.microsoft.com/fwlink/?LinkId=529064
Privacy Url: https://go.microsoft.com/fwlink/?LinkId=521839
Copyright: © 2022 Microsoft
Agreements:
Category: Productivity
Pricing: Free
Free Trial: No
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
Seizure Warning: https://aka.ms/microsoft-store-seizure-warning
Store License Terms: https://aka.ms/microsoft-store-license
The publisher requires that you view the above information and accept the agreements before installing.
Do you agree to the terms?
[Y] Yes [N] No: Y
Verifying/Requesting package acquisition...
Verifying/Requesting package acquisition success
Starting package install...
██████████████████████████████ 100%
Successfully installed
I am not sure to understand, but I think I have to insist on the fact that everything work (install apps from both msstore and winget sources, list apps, uninstall apps installed via winget...) EXCEPT uninstall some apps, like for instance Phone Link, Edge, Xbox Bar...
having the same issue
Same issue here.
- Duplicate of #1474
@ClementDelannoySlateDigital we've identified this Issue as a duplicate of another one that already exists. This specific instance is being closed in favor of tracking the concern over on the referenced Issue. Thanks for your report! Be sure to add your 👍 to the other issue to help raise the priority.
Hello, I'm still not sure that my issue is a duplicate of the one you linked, but I will continue to check the solutions for the other ticket. Thanks
I should have stated "interactive session". The Windows Package Manager doesn't get registered for an account until a user has "logged in" to an account on the local machine. If you log on as "system" then you can use winget in that account. If you're just remoting in, it may not be registered.
This is a bit troublesome considering that I am trying to remotely administer a bunch of VMs and winget commands are unable to resolve remotely.