microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.96k stars 1.43k forks source link

Error 0x80073cf3: Cannot upgrade Firefox because another package with the same name is installed #4752

Open 8549 opened 3 weeks ago

8549 commented 3 weeks ago

Brief description of your issue

When trying to upgrade Mozilla Firefox I receive this error message about a missing dependency:

winget upgrade -e Mozilla.Firefox --verbose
Trovato Mozilla Firefox [Mozilla.Firefox] Versione 129.0.2
Microsoft non è responsabile né concede alcuna licenza a pacchetti di terze parti.
Verifica dell'hash di installazione completata
Avvio installazione pacchetto in corso...
  ████████████████████████████▌   95%
Nel sistema manca una dipendenza per questo pacchetto.
Programma di installazione non riuscito con codice di uscita: '0x80073cf3 : Convalida degli aggiornamenti, delle dipendenze e dei conflitti del pacchetto non eseguita.'

I expected that winget is able to resolve any dependency tree issues. However, digging in the logs for the command execution, I find these interesting lines:

2024-08-23 11:08:16.668 [CORE] Deployment operation #1: Impossibile installare il pacchetto Mozilla.MozillaFirefox_129.0.2.0_x64__jag0gd4e3s9p2. È già installato un pacchetto Mozilla.MozillaFirefox_126.0.1.0_x64__gmpnhwe7bv608 diverso con lo stesso nome. Prima di eseguire l'installazione, rimuovere il pacchetto Mozilla.MozillaFirefox_126.0.1.0_x64__gmpnhwe7bv608.
2024-08-23 11:08:16.668 [FAIL] C:\__w\1\s\external\pkg\src\AppInstallerCommonCore\Deployment.cpp(192)\WindowsPackageManager.dll!00007FFAD4A46773: (caller: 00007FFAD4961BBD) Exception(1) tid(1274) 80073CF3 Convalida degli aggiornamenti, delle dipendenze e dei conflitti del pacchetto non eseguita.

Which roughly translate to: "Impossible to install Mozilla Firefox 129 package. There's a different Mozilla Firefox 126 package with the same name. Before installing, remove Mozilla Firefox 126" which seems absurd to me because I'm asking winget to upgrade the package.

Steps to reproduce

winget upgrade -e Mozilla.Firefox

Expected behavior

winget is able to upgrade Mozilla Firefox just fine as it does for other packages

Actual behavior

winget is unable to upgrade Mozilla Firefox because another version of the package is already installed

Environment

Gestione pacchetti Windows v1.8.1911
Copyright (c) Microsoft Corporation. Tutti i diritti sono riservati.

Windows: Windows.Desktop v10.0.19045.4780
Architettura di sistema: X64
Pacchetto: Microsoft.DesktopAppInstaller v1.23.1911.0

Directory WinGet
----------------------------------------------------------------------------------------------------------------------------------------
Log                                         %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Impostazioni utente                         %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Directory collegamenti portabili (utente)   %LOCALAPPDATA%\Microsoft\WinGet\Links
Directory collegamenti portabili (computer) C:\Program Files\WinGet\Links
Radice pacchetto portabile (utente)         %LOCALAPPDATA%\Microsoft\WinGet\Packages
Radice pacchetto portabile                  C:\Program Files\WinGet\Packages
Radice pacchetto portabile (x86)            C:\Program Files (x86)\WinGet\Packages
Download del programma di installazione     %USERPROFILE%\Downloads

Collegamenti
------------------------------------------------------------------------------------
Informativa sulla privacy    https://aka.ms/winget-privacy
Contratto di licenza         https://aka.ms/winget-license
Comunicazioni di terze parti https://aka.ms/winget-3rdPartyNotice
Home page                    https://aka.ms/winget
Condizioni di Windows Store  https://www.microsoft.com/en-us/storedocs/terms-of-sale

Impostazione amministrazione              Stato
------------------------------------------------------
LocalManifestFiles                        Disabilitate
BypassCertificatePinningForMicrosoftStore Disabilitate
InstallerHashOverride                     Disabilitate
LocalArchiveMalwareScanOverride           Disabilitate
ProxyCommandLineOptions                   Disabilitate
DefaultProxy                              Disabilitate
github-actions[bot] commented 3 weeks ago

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:

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

stephengillie commented 2 weeks ago

Hi @8549,

The package manager matches data from the Registry with data from manifests. And it appears that we do have Firefox 126.0 described in a manifest. So the package manager should be matching the linked manifest with the data in the computer's Registry.

I'm guessing that the version of Firefox 126 on your computer is somehow different than the version of Firefox 126 described in the manifest in our repo, and this is causing the package manager to generate the error we see. The UpgradeBehavior is to install the newest version, but when the package manager tries to do this, it finds that certain bits aren't in the right buckets and this process becomes blocked.

Install method can be important, and installing with one kind of installer, then upgrading with another kind, is not recommended. Usually, the package manager gives an error, but maybe this is an unusual situation.

[!Note] While researching this, I came across a version of Mozilla Firefox (ID 9NZVDKPMR9RD) available through the msstore source. This application has numerous installation paths.

8549 commented 2 weeks ago

Thank you for the information. Firefox was indeed installed with winget right after setting up the computer.

winget list -q firefox
Nome            Id              Versione  Disponibile Origine
-------------------------------------------------------------
Mozilla Firefox Mozilla.Firefox 126.0.1.0 129.0.2     winget

I could try to go through the uninstall and reinstall ordeal, but I'd consider that a workaround rather than a "solution" -- considering the issue has been caused by the package manager itself. Do you have any other suggestion before I try to do that?

stephengillie commented 1 week ago

In this case, I'm not sure of the best route forward.